--- mm/slub.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2007-09-12 19:53:26.000000000 -0700 +++ linux-2.6/mm/slub.c 2007-09-12 19:54:23.000000000 -0700 @@ -1081,12 +1081,9 @@ static struct page *new_slab(struct kmem BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | GFP_LEVEL_MASK)); - if (flags & __GFP_WAIT) - local_irq_enable(); - page = allocate_slab(s, flags & GFP_LEVEL_MASK, node); if (!page) - goto out; + return NULL; n = get_node(s, page_to_nid(page)); if (n) @@ -1116,9 +1113,6 @@ static struct page *new_slab(struct kmem page->freelist = start; page->lockless_freelist = NULL; page->inuse = 0; -out: - if (flags & __GFP_WAIT) - local_irq_disable(); return page; } @@ -1489,7 +1483,14 @@ new_slab: goto load_freelist; } + if (gfpflags & __GFP_WAIT) + local_irq_enable(); + page = new_slab(s, gfpflags, node); + + if (gfpflags & __GFP_WAIT) + local_irq_disable(); + if (page) { cpu = smp_processor_id(); if (s->cpu_slab[cpu]) { @@ -1899,12 +1900,6 @@ static struct kmem_cache_node * __init e 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; }