aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempool.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempool.c')
-rw-r--r--mm/mempool.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/mempool.c b/mm/mempool.c
index b014ffeaa413..d691b5cb8022 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -198,11 +198,16 @@ void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask)
198 void *element; 198 void *element;
199 unsigned long flags; 199 unsigned long flags;
200 DEFINE_WAIT(wait); 200 DEFINE_WAIT(wait);
201 int gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO); 201 int gfp_nowait;
202
203 gfp_mask |= __GFP_NOMEMALLOC; /* don't allocate emergency reserves */
204 gfp_mask |= __GFP_NORETRY; /* don't loop in __alloc_pages */
205 gfp_mask |= __GFP_NOWARN; /* failures are OK */
206 gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
202 207
203 might_sleep_if(gfp_mask & __GFP_WAIT); 208 might_sleep_if(gfp_mask & __GFP_WAIT);
204repeat_alloc: 209repeat_alloc:
205 element = pool->alloc(gfp_nowait|__GFP_NOWARN, pool->pool_data); 210 element = pool->alloc(gfp_nowait, pool->pool_data);
206 if (likely(element != NULL)) 211 if (likely(element != NULL))
207 return element; 212 return element;
208 213