aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-07-03 12:31:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-03 16:56:13 -0400
commitdbc55faa64c12f4c9fab6e2bd131d771bc026ed1 (patch)
treeb43ca5aa30dbfb9ab920db07039f8c76996fd17a /mm/slub.c
parent746976a301ac9c9aa10d7d42454f8d6cdad8ff2b (diff)
SLUB: Make lockdep happy by not calling add_partial with interrupts enabled during bootstrap
If we move the local_irq_enable() to the end of the function then add_partial() in early_kmem_cache_node_alloc() will be called with interrupts disabled like during regular operations. This makes lockdep happy. Signed-off-by: Christoph Lameter <clameter@sgi.com> Tested-by: Andre Noll <maan@systemlinux.org> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 202049a45764..0437f2f09986 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1798,8 +1798,6 @@ static struct kmem_cache_node * __init early_kmem_cache_node_alloc(gfp_t gfpflag
1798 BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node)); 1798 BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node));
1799 1799
1800 page = new_slab(kmalloc_caches, gfpflags | GFP_THISNODE, node); 1800 page = new_slab(kmalloc_caches, gfpflags | GFP_THISNODE, node);
1801 /* new_slab() disables interupts */
1802 local_irq_enable();
1803 1801
1804 BUG_ON(!page); 1802 BUG_ON(!page);
1805 n = page->freelist; 1803 n = page->freelist;
@@ -1811,6 +1809,12 @@ static struct kmem_cache_node * __init early_kmem_cache_node_alloc(gfp_t gfpflag
1811 init_kmem_cache_node(n); 1809 init_kmem_cache_node(n);
1812 atomic_long_inc(&n->nr_slabs); 1810 atomic_long_inc(&n->nr_slabs);
1813 add_partial(n, page); 1811 add_partial(n, page);
1812
1813 /*
1814 * new_slab() disables interupts. If we do not reenable interrupts here
1815 * then bootup would continue with interrupts disabled.
1816 */
1817 local_irq_enable();
1814 return n; 1818 return n;
1815} 1819}
1816 1820