diff options
| author | Christoph Lameter <clameter@sgi.com> | 2006-12-13 03:34:11 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:48 -0500 |
| commit | dd47ea755693228bf842c779e8afdfa47efb20a3 (patch) | |
| tree | 3dbaea0064765ff7dbc82e5bf0af73aba15dd6b2 | |
| parent | 6a8ba9d12150461acc91bd3c9124eac19e853218 (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>
| -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) | |||
| 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 | ||
| 3256 | retry: | 3257 | retry: |
| 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 |
