diff -u --recursive pre5/linux/mm/vmscan.c linux/mm/vmscan.c --- pre5/linux/mm/vmscan.c Tue Oct 30 08:51:13 2001 +++ linux/mm/vmscan.c Tue Oct 30 08:46:08 2001 @@ -515,20 +515,6 @@ } spin_unlock(&pagemap_lru_lock); - if (nr_pages <= 0) - return 0; - - /* - * If swapping out isn't appropriate, and - * we still fail, try the other (usually smaller) - * caches instead. - */ - shrink_dcache_memory(priority, gfp_mask); - shrink_icache_memory(priority, gfp_mask); -#ifdef CONFIG_QUOTA - shrink_dqcache_memory(DEF_PRIORITY, gfp_mask); -#endif - return nr_pages; } @@ -577,7 +563,17 @@ ratio = (unsigned long) nr_pages * nr_active_pages / ((nr_inactive_pages + 1) * 2); refill_inactive(ratio); - return shrink_cache(nr_pages, classzone, gfp_mask, priority); + nr_pages = shrink_cache(nr_pages, classzone, gfp_mask, priority); + if (nr_pages <= 0) + return 0; + + shrink_dcache_memory(priority, gfp_mask); + shrink_icache_memory(priority, gfp_mask); +#ifdef CONFIG_QUOTA + shrink_dqcache_memory(DEF_PRIORITY, gfp_mask); +#endif + + return nr_pages; } int try_to_free_pages(zone_t *classzone, unsigned int gfp_mask, unsigned int order)