[PATCH] [12/98] slub: fix panic with DISCONTIGMEM

From: Andi Kleen
Date: Tue Jul 26 2011 - 20:40:58 EST


2.6.35-longterm review patch. If anyone has any objections, please let me know.

------------------
From: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>

commit 4a5fa3590f09999f6db41bc386bce40848fa9f63 upstream.

Slub makes assumptions about page_to_nid() which are violated by
DISCONTIGMEM and !NUMA. This violation results in a panic because
page_to_nid() can be non-zero for pages in the discontiguous ranges and
this leads to a null return by get_node(). The assertion by the
maintainer is that DISCONTIGMEM should only be allowed when NUMA is also
defined. However, at least six architectures: alpha, ia64, m32r, m68k,
mips, parisc violate this. The panic is a regression against slab, so
just mark slub broken in the problem configuration to prevent users
reporting these panics.

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
Acked-by: Pekka Enberg <penberg@xxxxxxxxxx>
Signed-off-by: James Bottomley <James.Bottomley@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

---
init/Kconfig | 1 +
1 file changed, 1 insertion(+)

Index: linux-2.6.35.y/init/Kconfig
===================================================================
--- linux-2.6.35.y.orig/init/Kconfig
+++ linux-2.6.35.y/init/Kconfig
@@ -1087,6 +1087,7 @@ config SLAB
per cpu and per node queues.

config SLUB
+ depends on BROKEN || NUMA || !DISCONTIGMEM
bool "SLUB (Unqueued Allocator)"
help
SLUB is a slab allocator that minimizes cache line usage
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/