Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/vmscan.c |   21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)

diff -puN mm/vmscan.c~revert-vm-no-wild-kswapd mm/vmscan.c
--- 25/mm/vmscan.c~revert-vm-no-wild-kswapd	2004-10-07 23:46:20.937145824 -0700
+++ 25-akpm/mm/vmscan.c	2004-10-07 23:46:20.941145216 -0700
@@ -994,16 +994,12 @@ out:
 static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
 {
 	int to_free = nr_pages;
-	int all_zones_ok;
 	int priority;
 	int i;
-	int total_scanned, total_reclaimed;
+	int total_scanned = 0, total_reclaimed = 0;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
 	struct scan_control sc;
 
-loop_again:
-	total_scanned = 0;
-	total_reclaimed = 0;
 	sc.gfp_mask = GFP_KERNEL;
 	sc.may_writepage = 0;
 	sc.nr_mapped = read_page_state(nr_mapped);
@@ -1017,11 +1013,10 @@ loop_again:
 	}
 
 	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
+		int all_zones_ok = 1;
 		int end_zone = 0;	/* Inclusive.  0 = ZONE_DMA */
 		unsigned long lru_pages = 0;
 
-		all_zones_ok = 1;
-
 		if (nr_pages == 0) {
 			/*
 			 * Scan in the highmem->dma direction for the highest
@@ -1110,15 +1105,6 @@ scan:
 		 */
 		if (total_scanned && priority < DEF_PRIORITY - 2)
 			blk_congestion_wait(WRITE, HZ/10);
-
-		/*
-		 * We do this so kswapd doesn't build up large priorities for
-		 * example when it is freeing in parallel with allocators. It
-		 * matches the direct reclaim path behaviour in terms of impact
-		 * on zone->*_priority.
-		 */
-		if (total_reclaimed >= SWAP_CLUSTER_MAX)
-			break;
 	}
 out:
 	for (i = 0; i < pgdat->nr_zones; i++) {
@@ -1126,9 +1112,6 @@ out:
 
 		zone->prev_priority = zone->temp_priority;
 	}
-	if (!all_zones_ok)
-		goto loop_again;
-
 	return total_reclaimed;
 }
 
_