Skip to content

Commit

Permalink
[PATCH] zone reclaim: do not check references to a page during zone r…
Browse files Browse the repository at this point in the history
…eclaim

shrink_list() and refill_inactive() check all ptes pointing to a page for
reference bits in order to decide if the page should be put on the active
list.  This is not necessary for zone_reclaim since we are only interested
in removing unmapped pages.  Skip the checks in both functions.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 12, 2006
1 parent 643a654 commit 80e4342
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
BUG_ON(PageActive(page));

sc->nr_scanned++;

if (!sc->may_swap && page_mapped(page))
goto keep_locked;

/* Double the slab pressure for mapped and swapcache pages */
if (page_mapped(page) || PageSwapCache(page))
sc->nr_scanned++;
Expand Down Expand Up @@ -1231,7 +1235,7 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
* Now use this metric to decide whether to start moving mapped memory
* onto the inactive list.
*/
if (swap_tendency >= 100)
if (swap_tendency >= 100 && sc->may_swap)
reclaim_mapped = 1;

while (!list_empty(&l_hold)) {
Expand Down

0 comments on commit 80e4342

Please sign in to comment.