Commit dc05d09d authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] vmscan: pages_scanned fix

kswapd is still sometimes going into loops.  The problem seemed to be
happening on systems with zero inactive pages in ZONE_DMA, so pages_scanned
could never be increased, all_unreclaimable would never be set, and kswapd
would never break.

So change pages_scanned to be a count of the number of _active_ list pages
scanned rather than inactive.  This has been reported to solve the problems.

This is not subject to the reverse problem where one might have zero active
list pages, because inactive pages are either be reclaimed, or put onto the
active list.

I think it is reasonable to have all_unreclaimed trigger based on the amount
of active list scanning rather than inactive.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e9a9fc6a
......@@ -574,7 +574,6 @@ static void shrink_cache(struct zone *zone, struct scan_control *sc)
nr_taken++;
}
zone->nr_inactive -= nr_taken;
zone->pages_scanned += nr_taken;
spin_unlock_irq(&zone->lru_lock);
if (nr_taken == 0)
......@@ -675,6 +674,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
}
pgscanned++;
}
zone->pages_scanned += pgscanned;
zone->nr_active -= pgmoved;
spin_unlock_irq(&zone->lru_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment