Commit b8b50b65 authored by Paul Jackson's avatar Paul Jackson Committed by Linus Torvalds

[PATCH] mm: fallback_alloc cpuset_zone_allowed irq fix

fallback_alloc() could end up calling cpuset_zone_allowed() with interrupts
disabled (by code in kmem_cache_alloc_node()), but without __GFP_HARDWALL
set, leading to a possible call of a sleeping function with interrupts
disabled.

This results in the BUG report:

  BUG: sleeping function called from invalid context at kernel/cpuset.c:1520
in_atomic():0, irqs_disabled():1

Thanks to Paul Menage for catching this one.
Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
Cc: Paul Menage <menage@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 01a732eb
...@@ -3182,7 +3182,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) ...@@ -3182,7 +3182,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
for (z = zonelist->zones; *z && !obj; z++) { for (z = zonelist->zones; *z && !obj; z++) {
nid = zone_to_nid(*z); nid = zone_to_nid(*z);
if (cpuset_zone_allowed(*z, flags) && if (cpuset_zone_allowed(*z, flags | __GFP_HARDWALL) &&
cache->nodelists[nid] && cache->nodelists[nid] &&
cache->nodelists[nid]->free_objects) cache->nodelists[nid]->free_objects)
obj = ____cache_alloc_node(cache, obj = ____cache_alloc_node(cache,
......
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