]> git.karo-electronics.de Git - karo-tx-linux.git/commit
slab: fix bootstrap on memoryless node
authorPekka J Enberg <penberg@cs.helsinki.fi>
Sat, 26 Jan 2008 12:15:54 +0000 (14:15 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Feb 2008 19:46:21 +0000 (11:46 -0800)
commitf4ae0ab4b8237848ad5d687342a10cd3b7037705
tree922b5f7c61995f4637e7f90107e561117749267c
parenta869ec27f09435a48a6601c2c5543b457410b40c
slab: fix bootstrap on memoryless node

[ Upstream commit: 556a169dab38b5100df6f4a45b655dddd3db94c1 ]

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>
[ With additional one-liner by Olaf Hering  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
mm/slab.c