Query about might_sleep()

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

 



Hi,

   I am relatively new to RT. I have a query w.r.t might_sleep. I
might be asking on the wrong mailing list(perhaps I should try kernel
newbies).

   AFAIU, might_sleep() in a function means, the function can sleep.
If this function is called in atomic/interrupt context the kernel
throws out
 BUG: sleeping function called from invalid context at kernel/rtmu
tex.c. Am I correct so far?

   I was browsing the source, in rtmutex.c, in function rt_spin_lock(), which
calls rt_spin_lock_fastlock, there's a might_sleep() that's getting
called. I understand this is possible as spin_locks in PREEMPT_RT are
mutexes. But there could be a condition where this could be called
from some code holding spin_lock right?

for example

 __might_sleep
 rt_spin_lock
some_fucnction() --> which has a
local_irq_save(flags)/local_irq_irqrestore(flags).

This could be a potential bug right?

- Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux