2006-10-31 21:19:13

by Daniel Yeisley

[permalink] [raw]
Subject: [PATCH] init_reap_node() initialization fix

It looks like there is a bug in init_reap_node() in slab.c that can
cause multiple oops's on certain ES7000 configurations. The variable
reap_node is defined per cpu, but only initialized on a single CPU.
This causes an oops in next_reap_node() when __get_cpu_var(reap_node)
returns the wrong value. Fix is below.


Signed-off-by: Dan Yeisley <[email protected]>
---

diff -Naur linux-2.6.19-rc3-org/mm/slab.c linux-2.6.19-rc3-work/mm/slab.c
--- linux-2.6.19-rc3-org/mm/slab.c 2006-10-23 19:02:02.000000000 -0400
+++ linux-2.6.19-rc3-work/mm/slab.c 2006-10-30 11:45:28.000000000 -0500
@@ -883,7 +883,7 @@
if (node == MAX_NUMNODES)
node = first_node(node_online_map);

- __get_cpu_var(reap_node) = node;
+ per_cpu(reap_node,cpu) = node;
}

static void next_reap_node(void)





2006-10-31 21:26:05

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] init_reap_node() initialization fix

Daniel Yeisley <[email protected]> writes:

> It looks like there is a bug in init_reap_node() in slab.c that can
> cause multiple oops's on certain ES7000 configurations. The variable
> reap_node is defined per cpu, but only initialized on a single CPU.
> This causes an oops in next_reap_node() when __get_cpu_var(reap_node)
> returns the wrong value. Fix is below.

Agreed. The cpu up call back is usually called on the BP only,
so __get_cpu_var which uses a local variable is wrong here.

-Andi