vmscan: move referenced VM_EXEC pages to active list
Subsystems (3)
PATCH 1/1 vmscan: move referenced VM_EXEC pages to active list
In commit 64574746, "vmscan: detect mapped file pages used only once", Johannes Weiner, added logic to page_check_reference to cycle again used once pages.
In commit 8cab4754, "vmscan: make mapped executable pages the first class citizen", Wu Fengguang, added logic to shrink_active_list which protects file-backed VM_EXEC pages by keeping them in the active_list if they are referenced.
This patch adds logic to move such pages from the inactive list to the active list immediately if they have been referenced. If a VM_EXEC page is seen as referenced during an inactive list scan, that reference must have occurred after the page was put on the inactive list. There is no need to wait for the page to be referenced again.
--- mm/vmscan.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
mm/vmscan.c +11 -0
@@ -593,6 +593,17 @@ static enum page_references page_check_references(struct page *page,if (referenced_ptes) {if (PageAnon (page))return PAGEREF_ACTIVATE ; + +/* +* Identify referenced, file-backed active pages and move them +* to the active list. We know that this page has been +* referenced since being put on the inactive list. VM_EXEC +* pages are only moved to the inactive list when they have not +* been referenced between scans (see shrink_active_list). +*/ +if ((vm_flags &VM_EXEC ) &&page_is_file_cache (page)) +return PAGEREF_ACTIVATE ; +/* * All mapped pages start out with page table * references from the instantiating fault, so we need
Signature · 7 lines
1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>