]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.1.5/slab-lockdep-fix-silly-bug.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.5 / slab-lockdep-fix-silly-bug.patch
CommitLineData
7442bdc9
GKH
1From 52cef189165d74a5d6030184a8e05595194c69ca Mon Sep 17 00:00:00 2001
2From: Peter Zijlstra <a.p.zijlstra@chello.nl>
3Date: Mon, 28 Nov 2011 21:12:40 +0100
4Subject: slab, lockdep: Fix silly bug
5
6From: Peter Zijlstra <a.p.zijlstra@chello.nl>
7
8commit 52cef189165d74a5d6030184a8e05595194c69ca upstream.
9
10Commit 30765b92 ("slab, lockdep: Annotate the locks before using
11them") moves the init_lock_keys() call from after g_cpucache_up =
12FULL, to before it. And overlooks the fact that init_node_lock_keys()
13tests for it and ignores everything !FULL.
14
15Introduce a LATE stage and change the lockdep test to be <LATE.
16
17Acked-by: Christoph Lameter <cl@linux.com>
18Cc: Pekka Enberg <penberg@kernel.org>
19Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
20Signed-off-by: Ingo Molnar <mingo@elte.hu>
21Signed-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