aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2014-01-24 07:20:23 -0800
committerMoyster <oysterized@gmail.com>2016-09-28 15:14:31 +0200
commit6d920febf5a78394fb5da2ffa4b0cf6636b707d8 (patch)
treeac1e871d36da4863368a63f3c4535c4f26020552
parentd681fef0504df2481a4039eab3199b2a8a6f2898 (diff)
mm: slub: work around unneeded lockdep warning
The slub code does some setup during early boot in early_kmem_cache_node_alloc() with some local data. There is no possible way that another CPU can see this data, so the slub code doesn't unnecessarily lock it. However, some new lockdep asserts check to make sure that add_partial() _always_ has the list_lock held. Just add the locking, even though it is technically unnecessary. Cc: Peter Zijlstra <peterz@infradead.org> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: W4TCH0UT <ateekujjawal@gmail.com> Signed-off-by: Anik1199 <anik9280@gmail.com> Conflicts: mm/slub.c
-rw-r--r--mm/slub.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 82a3fffe6..06fb1a9d5 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1,3 +1,4 @@
+
/*
* SLUB: A slab allocator that limits cache line use instead of queuing
* objects in per cpu and per node lists.
@@ -3077,10 +3078,12 @@ static void early_kmem_cache_node_alloc(int node)
inc_slabs_node(kmem_cache_node, node, page->objects);
/*
- * No locks need to be taken here as it has just been
- * initialized and there is no concurrent access.
+ * the lock is for lockdep's sake, not for any actual
+ * race protection
*/
- __add_partial(n, page, DEACTIVATE_TO_HEAD);
+ spin_lock(&n->list_lock);
+ add_partial(n, page, DEACTIVATE_TO_HEAD);
+ spin_unlock(&n->list_lock);
}
static void free_kmem_cache_nodes(struct kmem_cache *s)