Commit dd47ea75 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[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: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6a8ba9d1
...@@ -3252,6 +3252,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) ...@@ -3252,6 +3252,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
struct zone **z; struct zone **z;
void *obj = NULL; void *obj = NULL;
int nid; int nid;
gfp_t local_flags = (flags & GFP_LEVEL_MASK);
retry: retry:
/* /*
...@@ -3275,7 +3276,12 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) ...@@ -3275,7 +3276,12 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
* We may trigger various forms of reclaim on the allowed * We may trigger various forms of reclaim on the allowed
* set and go into memory reserves if necessary. * set and go into memory reserves if necessary.
*/ */
if (local_flags & __GFP_WAIT)
local_irq_enable();
kmem_flagcheck(cache, flags);
obj = kmem_getpages(cache, flags, -1); obj = kmem_getpages(cache, flags, -1);
if (local_flags & __GFP_WAIT)
local_irq_disable();
if (obj) { if (obj) {
/* /*
* Insert into the appropriate per node queues * Insert into the appropriate per node queues
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment