[PATCH 08/10] slab, lockdep: Fix silly bug

From: Steven Rostedt
Date: Fri Dec 02 2011 - 20:39:13 EST


From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

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@xxxxxxxxxx
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Hans Schillstrom <hans@xxxxxxxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
Cc: Matt Mackall <mpm@xxxxxxxxxxx>
Cc: Sitsofe Wheeler <sitsofe@xxxxxxxxx>
Cc: linux-mm@xxxxxxxxx
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-gadqbdfxorhia1w5ewmoiodd@xxxxxxxxxxxxxx
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
mm/slab.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 015cd76..433b9a2 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();

--
1.7.7.1


Attachment: signature.asc
Description: This is a digitally signed message part