Commit b488ea81 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] vm: shrink slab evenly in try_to_free_pages()

From: Nick Piggin <piggin@cyberone.com.au>

In try_to_free_pages(), put even pressure on the slab even if we have
reclaimed enough pages from the LRU.
parent dee96113
......@@ -875,6 +875,13 @@ int try_to_free_pages(struct zone **zones,
get_page_state(&ps);
nr_reclaimed += shrink_caches(zones, priority, &total_scanned,
gfp_mask, nr_pages, &ps);
if (zones[0] - zones[0]->zone_pgdat->node_zones < ZONE_HIGHMEM) {
shrink_slab(total_scanned, gfp_mask);
if (reclaim_state) {
nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0;
}
}
if (nr_reclaimed >= nr_pages) {
ret = 1;
goto out;
......@@ -890,13 +897,6 @@ int try_to_free_pages(struct zone **zones,
/* Take a nap, wait for some writeback to complete */
blk_congestion_wait(WRITE, HZ/10);
if (zones[0] - zones[0]->zone_pgdat->node_zones < ZONE_HIGHMEM) {
shrink_slab(total_scanned, gfp_mask);
if (reclaim_state) {
nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0;
}
}
}
if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
out_of_memory();
......
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