diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2012-01-10 18:07:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 19:30:41 -0500 |
commit | c909e99364c8b6ca07864d752950b6b4ecf6bef4 (patch) | |
tree | 9942e7a9aeac9a334bb7b4a01c4add8e927b6218 | |
parent | 34dbc67a644f11ab3475d822d72e25409911e760 (diff) |
vmscan: activate executable pages after first usage
Logic added in commit 8cab4754d24a0 ("vmscan: make mapped executable pages
the first class citizen") was noticeably weakened in commit
645747462435d84 ("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>
-rw-r--r-- | mm/vmscan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 753c1e6755f0..753a2dc300b9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -718,6 +718,12 @@ static enum page_references page_check_references(struct page *page, | |||
718 | if (referenced_page || referenced_ptes > 1) | 718 | if (referenced_page || referenced_ptes > 1) |
719 | return PAGEREF_ACTIVATE; | 719 | return PAGEREF_ACTIVATE; |
720 | 720 | ||
721 | /* | ||
722 | * Activate file-backed executable pages after first usage. | ||
723 | */ | ||
724 | if (vm_flags & VM_EXEC) | ||
725 | return PAGEREF_ACTIVATE; | ||
726 | |||
721 | return PAGEREF_KEEP; | 727 | return PAGEREF_KEEP; |
722 | } | 728 | } |
723 | 729 | ||