diff options
author | Hugh Dickins <hughd@google.com> | 2011-01-13 18:47:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:49 -0500 |
commit | 2919bfd0758257c469abef8c26c3e516bbebb851 (patch) | |
tree | 093244c121dcbb91423f119cea9abc50e11ad078 /mm/ksm.c | |
parent | 73ae31e5986a4c0ee84bfd13ccd9b57a98956f6f (diff) |
ksm: drain pagevecs to lru
It was hard to explain the page counts which were causing new LTP tests
of KSM to fail: we need to drain the per-cpu pagevecs to LRU occasionally.
Signed-off-by: Hugh Dickins <hughd@google.com>
Reported-by: CAI Qian <caiqian@redhat.com>
Cc:Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1296,6 +1296,18 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page) | |||
1296 | 1296 | ||
1297 | slot = ksm_scan.mm_slot; | 1297 | slot = ksm_scan.mm_slot; |
1298 | if (slot == &ksm_mm_head) { | 1298 | if (slot == &ksm_mm_head) { |
1299 | /* | ||
1300 | * A number of pages can hang around indefinitely on per-cpu | ||
1301 | * pagevecs, raised page count preventing write_protect_page | ||
1302 | * from merging them. Though it doesn't really matter much, | ||
1303 | * it is puzzling to see some stuck in pages_volatile until | ||
1304 | * other activity jostles them out, and they also prevented | ||
1305 | * LTP's KSM test from succeeding deterministically; so drain | ||
1306 | * them here (here rather than on entry to ksm_do_scan(), | ||
1307 | * so we don't IPI too often when pages_to_scan is set low). | ||
1308 | */ | ||
1309 | lru_add_drain_all(); | ||
1310 | |||
1299 | root_unstable_tree = RB_ROOT; | 1311 | root_unstable_tree = RB_ROOT; |
1300 | 1312 | ||
1301 | spin_lock(&ksm_mmlist_lock); | 1313 | spin_lock(&ksm_mmlist_lock); |