
From: Nick Piggin <nickpiggin@yahoo.com.au>

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: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/vmscan.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN mm/vmscan.c~vmscan-reclaim-swap_cluster_max-pages-in-a-single-pass mm/vmscan.c
--- 25/mm/vmscan.c~vmscan-reclaim-swap_cluster_max-pages-in-a-single-pass	2005-03-07 20:41:22.000000000 -0800
+++ 25-akpm/mm/vmscan.c	2005-03-07 21:14:56.000000000 -0800
@@ -917,12 +917,12 @@ int try_to_free_pages(struct zone **zone
 			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
_
