Re: inconsistent lock state on call to kmem_cache_zalloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Baluta wrote:
> On Thu, Mar 17, 2011 at 10:59 PM, Arvid Brodin <arvid.brodin@xxxxxxxx> wrote:
>> Hi,
>>
>> Daniel Baluta wrote:
>>> Hello,
>>>
>>>> The call to kmem_cache_zalloc() never returns; the printk() text on the line
>>>> after is never displayed and the system locks up. The printk() om the line
>>>> before displays.
>>> What flags are you passing to kmem_cache_zalloc?
>> I'm using the flags passed to the urb_enqueue() function; a printk reveals
>> the value is 16, which would be GFP_NOIO if I read include/linux/gfp.h correctly.
> 
> Hmm, I guess this is not quite OK. You hold a spinlock, and you can sleep
> while allocating memory.

I can see why this is not a good idea, and indeed using GFP_ATOMIC gets rid of the

=================================
[ INFO: inconsistent lock state ]
2.6.37 #116
---------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
...

message. Many thanks!

To the list in general:

Still, I would have expected some kind of "You're sleeping while holding a
spinlock / with interrupts disabled!" message (I have DEBUG_SPINLOCK_SLEEP
enabled), not a message from the lock debug code. Well... perhaps one of the
'W's in the message stands for "wait"? Also, the call stack in my original
mail shows the interrupt routine being called despite having disabled
interrupts - are they automatically enabled by functions that sleep?

> 
> Daniel.

-- 
Arvid Brodin
Enea Services Stockholm AB

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux