Skip to content

Commit

Permalink
vmscan: activate executable pages after first usage
Browse files Browse the repository at this point in the history
Logic added in commit 8cab475 ("vmscan: make mapped executable pages
the first class citizen") was noticeably weakened in commit
6457474 ("vmscan: detect mapped file pages used only once").

Currently these pages can become "first class citizens" only after second
usage.  After this patch page_check_references() will activate they after
first usage, and executable code gets yet better chance to stay in memory.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Jan 11, 2012
1 parent 34dbc67 commit c909e99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,12 @@ static enum page_references page_check_references(struct page *page,
if (referenced_page || referenced_ptes > 1)
return PAGEREF_ACTIVATE;

/*
* Activate file-backed executable pages after first usage.
*/
if (vm_flags & VM_EXEC)
return PAGEREF_ACTIVATE;

return PAGEREF_KEEP;
}

Expand Down

0 comments on commit c909e99

Please sign in to comment.