Signed-off-by: Andrew Morton --- 25-akpm/mm/vmscan.c | 23 ++--------------------- 1 files changed, 2 insertions(+), 21 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-16 22:47:08.021270728 -0700 +++ 25-akpm/mm/vmscan.c 2004-10-16 22:47:26.221503872 -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 @@ -1111,15 +1106,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++) { @@ -1127,11 +1113,6 @@ out: zone->prev_priority = zone->temp_priority; } - if (!all_zones_ok) { - cond_resched(); - goto loop_again; - } - return total_reclaimed; } _