Re: percpu related boot crash on x86 (was: Linux 2.6.38-rc1)

From: Peter Zijlstra
Date: Wed Jan 19 2011 - 08:12:01 EST


On Wed, 2011-01-19 at 14:56 +0200, Pekka Enberg wrote:
>
> On Wed, Jan 19, 2011 at 2:48 PM, Peter Zijlstra
> <a.p.zijlstra@xxxxxxxxx> wrote:
> > start_kernel()
> > local_irq_disable()
> > ...
> > early_irq_init()
> > alloc_desc()
> > alloc_percpu()
> > __alloc_percpu()
> > pcpu_alloc()
> > pcpu_extend_area_map()
> > pcpu_mem_free()
> > vfree()
> > __vunmap()
> > remove_vm_area()
> > free_unmap_vmap_area()
> > vmap_debug_free_range()
> > #ifdef CONFIG_DEBUG_PAGEALLOC
> > flush_tlb_kernel_range()
> > flush_tlb_all()
> > on_each_cpu()
> > smp_call_function()
> > WARN_ON_ONCE(irqs_disabled()....);
> >
> >
> > Not quite sure that to do about that though..
>
> Is vmalloc() and vfree() supposed to work with interrupts disabled?

I'm not sure about vmalloc(), but vfree() has been known to not work
with IRQs disabled for a long long while.

Looking at the code neither can work, since vmalloc() can end up calling
vfree(), what's curious though is that all the BUG_ON()s in there are on
in_interrupt() instead of for irqs_disabled().

> I always thought they weren't which would mean something in
> pcpu_mem_alloc() needs changing...

Is alloc_percpu() supposed to work from atomic context?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/