Skip to content

Commit

Permalink
[PATCH] vmscan: no zone_reclaim if PF_MALLOC is set
Browse files Browse the repository at this point in the history
If the process has already set PF_MALLOC and is already using
current->reclaim_state then do not try to reclaim memory from the zone.
This is set by kswapd and/or synchrononous global reclaim which will not
take it lightly if we zap the reclaim_state.

Signed-off-by: Christoph Lameter <clameter@sig.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Mar 10, 2006
1 parent 04b857f commit a6bf527
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,8 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)

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;
Expand Down

0 comments on commit a6bf527

Please sign in to comment.