提交 aedb0eb1 编写于 作者: C Christoph Lameter 提交者: Linus Torvalds

[PATCH] Slab: Do not fallback to nodes that have not been bootstrapped yet

The zonelist may contain zones of nodes that have not been bootstrapped and
we will oops if we try to allocate from those zones.  So check if the node
information for the slab and the node have been setup before attempting an
allocation.  If it has not been setup then skip that zone.

Usually we will not encounter this situation since the slab bootstrap code
avoids falling back before we have setup the respective nodes but we seem
to have a special needs for pppc.
Signed-off-by: NChristoph Lameter <clameter@sgi.com>
Acked-by: NAndy Whitcroft <apw@shadowen.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Kravetz <kravetz@us.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: NMel Gorman <mel@csn.ul.ie>
Acked-by: NWill Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 75167957
......@@ -3152,12 +3152,15 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
struct zone **z;
void *obj = NULL;
for (z = zonelist->zones; *z && !obj; z++)
for (z = zonelist->zones; *z && !obj; z++) {
int nid = zone_to_nid(*z);
if (zone_idx(*z) <= ZONE_NORMAL &&
cpuset_zone_allowed(*z, flags))
cpuset_zone_allowed(*z, flags) &&
cache->nodelists[nid])
obj = __cache_alloc_node(cache,
flags | __GFP_THISNODE,
zone_to_nid(*z));
flags | __GFP_THISNODE, nid);
}
return obj;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册