aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-11-28 21:12:40 +0100
committerSteven Rostedt <rostedt@goodmis.org>2012-01-24 10:56:32 -0500
commit6a5222a26a8233ef4e2f31f9cc6663c6bf556321 (patch)
treed4187d13df74889508f752c695bc1d4a24765b17
parent5850f427712cfc7d70e915abc888824b5a4982a1 (diff)
slab, lockdep: Fix silly bug
Commit 30765b92 ("slab, lockdep: Annotate the locks before using them") moves the init_lock_keys() call from after g_cpucache_up = FULL, to before it. And overlooks the fact that init_node_lock_keys() tests for it and ignores everything !FULL. Introduce a LATE stage and change the lockdep test to be <LATE. Cc: stable@kernel.org Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Hans Schillstrom <hans@schillstrom.com> Cc: Christoph Lameter <cl@gentwo.org> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Matt Mackall <mpm@selenic.com> Cc: Sitsofe Wheeler <sitsofe@yahoo.com> Cc: linux-mm@kvack.org Cc: David Rientjes <rientjes@google.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/n/tip-gadqbdfxorhia1w5ewmoiodd@git.kernel.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--mm/slab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 015cd76a1a24..433b9a2b0b31 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -594,6 +594,7 @@ static enum {
PARTIAL_AC,
PARTIAL_L3,
EARLY,
+ LATE,
FULL
} g_cpucache_up;
@@ -670,7 +671,7 @@ static void init_node_lock_keys(int q)
{
struct cache_sizes *s = malloc_sizes;
- if (g_cpucache_up != FULL)
+ if (g_cpucache_up < LATE)
return;
for (s = malloc_sizes; s->cs_size != ULONG_MAX; s++) {
@@ -1725,6 +1726,8 @@ void __init kmem_cache_init_late(void)
{
struct kmem_cache *cachep;
+ g_cpucache_up = LATE;
+
/* Annotate slab for lockdep -- annotate the malloc caches */
init_lock_keys();