Re: 2.6.18-rc7-mm1 -- ppc64 crash in slab_node ??

From: Christoph Lameter
Date: Thu Sep 21 2006 - 14:03:05 EST


On Thu, 21 Sep 2006, Andrew Morton wrote:

> I guess the below will fix it. But Christoph's machine would have oopsed
> too, if it had called fallback_alloc() this early. So presumably it did
> not. But yours does. I wonder why?

Hmmm... Fallback during boot? Any zones that have no ZONE_NORMAL memory?

The right fix though is to check for a NULL memory policy in slab_node.
This is the way other mempol functions behave.

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>

Index: linux-2.6.18-rc7-mm1/mm/mempolicy.c
===================================================================
--- linux-2.6.18-rc7-mm1.orig/mm/mempolicy.c 2006-09-19 09:27:03.000000000 -0500
+++ linux-2.6.18-rc7-mm1/mm/mempolicy.c 2006-09-21 12:59:09.385528424 -0500
@@ -1136,7 +1136,9 @@ static unsigned interleave_nodes(struct
*/
unsigned slab_node(struct mempolicy *policy)
{
- switch (policy->policy) {
+ int pol = policy ? policy->policy : MPOL_DEFAULT;
+
+ switch (pol) {
case MPOL_INTERLEAVE:
return interleave_nodes(policy);

-
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/