diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-12-13 08:34:11 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 17:05:48 (GMT) |
commit | dd47ea755693228bf842c779e8afdfa47efb20a3 (patch) | |
tree | 3dbaea0064765ff7dbc82e5bf0af73aba15dd6b2 /mm | |
parent | 6a8ba9d12150461acc91bd3c9124eac19e853218 (diff) | |
download | linux-dd47ea755693228bf842c779e8afdfa47efb20a3.tar.xz |
[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')
-rw-r--r-- | mm/slab.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -3252,6 +3252,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) struct zone **z; void *obj = NULL; int nid; + gfp_t local_flags = (flags & GFP_LEVEL_MASK); retry: /* @@ -3275,7 +3276,12 @@ retry: * We may trigger various forms of reclaim on the allowed * 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); + if (local_flags & __GFP_WAIT) + local_irq_disable(); if (obj) { /* * Insert into the appropriate per node queues |