Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ksm: drain pagevecs to lru
  • Loading branch information
Squadzone authored and burstlam committed Mar 6, 2012
1 parent 426631e commit b398f92
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mm/ksm.c
Expand Up @@ -1268,6 +1268,18 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)


slot = ksm_scan.mm_slot; slot = ksm_scan.mm_slot;
if (slot == &ksm_mm_head) { if (slot == &ksm_mm_head) {
/*
* A number of pages can hang around indefinitely on per-cpu
* pagevecs, raised page count preventing write_protect_page
* from merging them. Though it doesn't really matter much,
* it is puzzling to see some stuck in pages_volatile until
* other activity jostles them out, and they also prevented
* LTP's KSM test from succeeding deterministically; so drain
* them here (here rather than on entry to ksm_do_scan(),
* so we don't IPI too often when pages_to_scan is set low).
*/
lru_add_drain_all();

root_unstable_tree = RB_ROOT; root_unstable_tree = RB_ROOT;


spin_lock(&ksm_mmlist_lock); spin_lock(&ksm_mmlist_lock);
Expand Down

0 comments on commit b398f92

Please sign in to comment.