use __GFP_NOKILL in mempool_alloc()
Subsystems (2)
PATCH 4/13 use __GFP_NOKILL in mempool_alloc()
It is permissible to perform mempool allocations with __GFP_FS. While no current caller does so, the following prevents pool->alloc() from invoking the OOM killer when the request is serviceable by just waiting on the mempool.
mm/mempool.c +5 -1
@@ -186,8 +186,12 @@void *element;unsigned long flags;DEFINE_WAIT (wait); -int gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO); +int gfp_nowait;int pf_flags = current->flags; + + gfp_mask |= __GFP_NOKILL; + + gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO | __GFP_NOKILL); repeat_alloc: current->flags |=PF_NOWARN ;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/