Badness on the Warp

Pekka Enberg penberg at cs.helsinki.fi
Sun Jun 21 20:20:56 EST 2009


On Sun, Jun 21, 2009 at 7:28 AM, Frans Pop<elendil at planet.nl> wrote:
> On Sunday 21 June 2009, Sean MacLennan wrote:
>> I found the source of the badness. The backtrace is correct:
>>
>> uic_init_one
>
> So that's in arch/powerpc/sysdev/uic.c.
>
>> ___alloc_bootmem
>> ___alloc_bootmem_nopanic
>> alloc_arch_preferred_bootmem
>>
>> In alloc_arch_preferred_bootmem we have:
>>
>>       if (WARN_ON_ONCE(slab_is_available()))
>>               return kzalloc(size, GFP_NOWAIT);
>>
>> Since the slab is available (it had better be or the call will return
>> NULL), we get the badness message, then a successful return from
>> kzalloc.
>>
>> I believe the author wants something like:
>>
>>       if (slab_is_available())
>>               return kzalloc(size, GFP_NOWAIT);
>>       else
>>               WARN_ON_ONCE(1);
>
> Well, I myself have no idea. It could also indicate a bug in the uic code.
>
> But let's CC some people responsible for this code. Pekka recently added
> this WARN that triggers in your case; David and Paul look to be the
> people most involved in the uic code.
>
> Start of the thread is at http://lkml.org/lkml/2009/6/20/165.

The WARN_ON() is there to let us know that someone is doing a bootmem
allocation but the slab allocator is already up. So the proper fix
here is to use kmalloc() directly in the call-site that triggers this
WARN_ON. I'm cc'ing Ben as he has been taking care of the fall-out
from my patches on ppc.

                                  Pekka


More information about the Linuxppc-dev mailing list