Skip to content

Commit

Permalink
SLUB: Make lockdep happy by not calling add_partial with interrupts e…
Browse files Browse the repository at this point in the history
…nabled 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>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jul 3, 2007
1 parent 746976a commit dbc55fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,8 +1798,6 @@ static struct kmem_cache_node * __init early_kmem_cache_node_alloc(gfp_t gfpflag
BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node));

page = new_slab(kmalloc_caches, gfpflags | GFP_THISNODE, node);
/* new_slab() disables interupts */
local_irq_enable();

BUG_ON(!page);
n = page->freelist;
Expand All @@ -1811,6 +1809,12 @@ static struct kmem_cache_node * __init early_kmem_cache_node_alloc(gfp_t gfpflag
init_kmem_cache_node(n);
atomic_long_inc(&n->nr_slabs);
add_partial(n, page);

/*
* new_slab() disables interupts. If we do not reenable interrupts here
* then bootup would continue with interrupts disabled.
*/
local_irq_enable();
return n;
}

Expand Down

0 comments on commit dbc55fa

Please sign in to comment.