Commit 5f1543f1 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] vmscan: reclaim SWAP_CLUSTER_MAX pages in a single pass

Here is another small OOM killer improvement.  Previously we needed to
reclaim SWAP_CLUSTER_MAX pages in a single pass.  That should be changed so
that we need only reclaim that many pages during the entire
try_to_free_pages run, without going OOM.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9fe1f5e6
......@@ -917,12 +917,12 @@ int try_to_free_pages(struct zone **zones,
sc.nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0;
}
if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX) {
total_scanned += sc.nr_scanned;
total_reclaimed += sc.nr_reclaimed;
if (total_reclaimed >= SWAP_CLUSTER_MAX) {
ret = 1;
goto out;
}
total_scanned += sc.nr_scanned;
total_reclaimed += sc.nr_reclaimed;
/*
* Try to write back as many pages as we just scanned. This
......
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