aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-07-28 17:22:56 -0400
committerIngo Molnar <mingo@elte.hu>2011-08-04 04:18:00 -0400
commit30765b92ada267c5395fc788623cb15233276f5c (patch)
tree83d4f62be66252537b634880170015ed051faa6e /mm/slab.c
parentf59de8992aa6dc85e81aadc26b0f69e17809721d (diff)
slab, lockdep: Annotate the locks before using them
Fernando found we hit the regular OFF_SLAB 'recursion' before we annotate the locks, cure this. The relevant portion of the stack-trace: > [ 0.000000] [<c085e24f>] rt_spin_lock+0x50/0x56 > [ 0.000000] [<c04fb406>] __cache_free+0x43/0xc3 > [ 0.000000] [<c04fb23f>] kmem_cache_free+0x6c/0xdc > [ 0.000000] [<c04fb2fe>] slab_destroy+0x4f/0x53 > [ 0.000000] [<c04fb396>] free_block+0x94/0xc1 > [ 0.000000] [<c04fc551>] do_tune_cpucache+0x10b/0x2bb > [ 0.000000] [<c04fc8dc>] enable_cpucache+0x7b/0xa7 > [ 0.000000] [<c0bd9d3c>] kmem_cache_init_late+0x1f/0x61 > [ 0.000000] [<c0bba687>] start_kernel+0x24c/0x363 > [ 0.000000] [<c0bba0ba>] i386_start_kernel+0xa9/0xaf Reported-by: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU> Acked-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1311888176.2617.379.camel@laptop Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 0703578fb4d7..6d90a091fdca 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1666,6 +1666,9 @@ void __init kmem_cache_init_late(void)
1666{ 1666{
1667 struct kmem_cache *cachep; 1667 struct kmem_cache *cachep;
1668 1668
1669 /* Annotate slab for lockdep -- annotate the malloc caches */
1670 init_lock_keys();
1671
1669 /* 6) resize the head arrays to their final sizes */ 1672 /* 6) resize the head arrays to their final sizes */
1670 mutex_lock(&cache_chain_mutex); 1673 mutex_lock(&cache_chain_mutex);
1671 list_for_each_entry(cachep, &cache_chain, next) 1674 list_for_each_entry(cachep, &cache_chain, next)
@@ -1676,9 +1679,6 @@ void __init kmem_cache_init_late(void)
1676 /* Done! */ 1679 /* Done! */
1677 g_cpucache_up = FULL; 1680 g_cpucache_up = FULL;
1678 1681
1679 /* Annotate slab for lockdep -- annotate the malloc caches */
1680 init_lock_keys();
1681
1682 /* 1682 /*
1683 * Register a cpu startup notifier callback that initializes 1683 * Register a cpu startup notifier callback that initializes
1684 * cpu_cache_get for all new cpus 1684 * cpu_cache_get for all new cpus