slab: fix bootstrap on memoryless node
authorPekka Enberg <penberg@cs.helsinki.fi>
Fri, 25 Jan 2008 06:20:51 +0000 (08:20 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Jan 2008 16:30:36 +0000 (08:30 -0800)
commit556a169dab38b5100df6f4a45b655dddd3db94c1
treec7788980db8dfb401dd4cf28f4445e1ab98f51d2
parenteb36f4fc019835cecf0788907f6cab774508087b
slab: fix bootstrap on memoryless node

If the node we're booting on doesn't have memory, bootstrapping kmalloc()
caches resorts to fallback_alloc() which requires ->nodelists set for all
nodes.  Fix that by calling set_up_list3s() for CACHE_CACHE in
kmem_cache_init().

As kmem_getpages() is called with GFP_THISNODE set, this used to work before
because of breakage in 2.6.22 and before with GFP_THISNODE returning pages from
the wrong node if a node had no memory. So it may have worked accidentally and
in an unsafe manner because the pages would have been associated with the wrong
node which could trigger bug ons and locking troubles.

Tested-by: Mel Gorman <mel@csn.ul.ie>
Tested-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
[ With additional one-liner by Olaf Hering  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab.c