aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-12-13 03:34:11 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:48 -0500
commitdd47ea755693228bf842c779e8afdfa47efb20a3 (patch)
tree3dbaea0064765ff7dbc82e5bf0af73aba15dd6b2 /mm/slab.c
parent6a8ba9d12150461acc91bd3c9124eac19e853218 (diff)
[PATCH] slab: fix sleeping in atomic bug
Fallback_alloc() does not do the check for GFP_WAIT as done in cache_grow(). Thus interrupts are disabled when we call kmem_getpages() which results in the failure. Duplicate the handling of GFP_WAIT in cache_grow(). Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Jay Cliburn <jacliburn@bellsouth.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 2c655532f5ef..c7576b9027a6 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3252,6 +3252,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
3252 struct zone **z; 3252 struct zone **z;
3253 void *obj = NULL; 3253 void *obj = NULL;
3254 int nid; 3254 int nid;
3255 gfp_t local_flags = (flags & GFP_LEVEL_MASK);
3255 3256
3256retry: 3257retry:
3257 /* 3258 /*
@@ -3275,7 +3276,12 @@ retry:
3275 * We may trigger various forms of reclaim on the allowed 3276 * We may trigger various forms of reclaim on the allowed
3276 * set and go into memory reserves if necessary. 3277 * set and go into memory reserves if necessary.
3277 */ 3278 */
3279 if (local_flags & __GFP_WAIT)
3280 local_irq_enable();
3281 kmem_flagcheck(cache, flags);
3278 obj = kmem_getpages(cache, flags, -1); 3282 obj = kmem_getpages(cache, flags, -1);
3283 if (local_flags & __GFP_WAIT)
3284 local_irq_disable();
3279 if (obj) { 3285 if (obj) {
3280 /* 3286 /*
3281 * Insert into the appropriate per node queues 3287 * Insert into the appropriate per node queues