Skip to content

Commit

Permalink
slab, lockdep: Fix silly bug
Browse files Browse the repository at this point in the history
Commit 30765b9 ("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.

Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 5, 2011
1 parent 8e8da02 commit 52cef18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ static enum {
PARTIAL_AC,
PARTIAL_L3,
EARLY,
LATE,
FULL
} g_cpucache_up;

Expand Down Expand Up @@ -671,7 +672,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++) {
Expand Down Expand Up @@ -1666,6 +1667,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();

Expand Down

0 comments on commit 52cef18

Please sign in to comment.