提交 52cef189 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

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.
Acked-by: NChristoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: stable@kernel.org
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 8e8da023
...@@ -595,6 +595,7 @@ static enum { ...@@ -595,6 +595,7 @@ static enum {
PARTIAL_AC, PARTIAL_AC,
PARTIAL_L3, PARTIAL_L3,
EARLY, EARLY,
LATE,
FULL FULL
} g_cpucache_up; } g_cpucache_up;
...@@ -671,7 +672,7 @@ static void init_node_lock_keys(int q) ...@@ -671,7 +672,7 @@ static void init_node_lock_keys(int q)
{ {
struct cache_sizes *s = malloc_sizes; struct cache_sizes *s = malloc_sizes;
if (g_cpucache_up != FULL) if (g_cpucache_up < LATE)
return; return;
for (s = malloc_sizes; s->cs_size != ULONG_MAX; s++) { for (s = malloc_sizes; s->cs_size != ULONG_MAX; s++) {
...@@ -1666,6 +1667,8 @@ void __init kmem_cache_init_late(void) ...@@ -1666,6 +1667,8 @@ void __init kmem_cache_init_late(void)
{ {
struct kmem_cache *cachep; struct kmem_cache *cachep;
g_cpucache_up = LATE;
/* Annotate slab for lockdep -- annotate the malloc caches */ /* Annotate slab for lockdep -- annotate the malloc caches */
init_lock_keys(); init_lock_keys();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册