Index: linux-2.6.16-rc5-mm3/mm/vmscan.c =================================================================== --- linux-2.6.16-rc5-mm3.orig/mm/vmscan.c 2006-03-07 09:17:26.000000000 -0800 +++ linux-2.6.16-rc5-mm3/mm/vmscan.c 2006-03-08 20:02:11.000000000 -0800 @@ -1929,10 +1929,14 @@ int zone_reclaim(struct zone *zone, gfp_ * Avoid concurrent zone reclaims, do not reclaim in a zone that does * not have reclaimable pages and if we should not delay the allocation * then do not scan. + * If PF_MEMALLOC is set then synchrononous reclaim or kswapd is running. + * So someone is already taking care of the memory problem using + * the reclaim_state that we cannot touch. */ if (!(gfp_mask & __GFP_WAIT) || zone->all_unreclaimable || - atomic_read(&zone->reclaim_in_progress) > 0) + atomic_read(&zone->reclaim_in_progress) > 0 || + (p->flags & PF_MEMALLOC)) return 0; node_id = zone->zone_pgdat->node_id;