]>
Commit | Line | Data |
---|---|---|
7442bdc9 GKH |
1 | From 52cef189165d74a5d6030184a8e05595194c69ca Mon Sep 17 00:00:00 2001 |
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
3 | Date: Mon, 28 Nov 2011 21:12:40 +0100 | |
4 | Subject: slab, lockdep: Fix silly bug | |
5 | ||
6 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
7 | ||
8 | commit 52cef189165d74a5d6030184a8e05595194c69ca upstream. | |
9 | ||
10 | Commit 30765b92 ("slab, lockdep: Annotate the locks before using | |
11 | them") moves the init_lock_keys() call from after g_cpucache_up = | |
12 | FULL, to before it. And overlooks the fact that init_node_lock_keys() | |
13 | tests for it and ignores everything !FULL. | |
14 | ||
15 | Introduce a LATE stage and change the lockdep test to be <LATE. | |
16 | ||
17 | Acked-by: Christoph Lameter <cl@linux.com> | |
18 | Cc: Pekka Enberg <penberg@kernel.org> | |
19 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
20 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
22 | ||
23 | --- | |
24 | mm/slab.c | 5 ++++- | |
25 | 1 file changed, 4 insertions(+), 1 deletion(-) | |
26 | ||
27 | --- a/mm/slab.c | |
28 | +++ b/mm/slab.c | |
29 | @@ -595,6 +595,7 @@ static enum { | |
30 | PARTIAL_AC, | |
31 | PARTIAL_L3, | |
32 | EARLY, | |
33 | + LATE, | |
34 | FULL | |
35 | } g_cpucache_up; | |
36 | ||
37 | @@ -671,7 +672,7 @@ static void init_node_lock_keys(int q) | |
38 | { | |
39 | struct cache_sizes *s = malloc_sizes; | |
40 | ||
41 | - if (g_cpucache_up != FULL) | |
42 | + if (g_cpucache_up < LATE) | |
43 | return; | |
44 | ||
45 | for (s = malloc_sizes; s->cs_size != ULONG_MAX; s++) { | |
46 | @@ -1666,6 +1667,8 @@ void __init kmem_cache_init_late(void) | |
47 | { | |
48 | struct kmem_cache *cachep; | |
49 | ||
50 | + g_cpucache_up = LATE; | |
51 | + | |
52 | /* Annotate slab for lockdep -- annotate the malloc caches */ | |
53 | init_lock_keys(); | |
54 |