linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query about might_sleep()
@ 2014-02-26  6:55 doug lkml
  2014-02-27  2:55 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: doug lkml @ 2014-02-26  6:55 UTC (permalink / raw)
  To: linux-rt-users

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-27  4:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26  6:55 Query about might_sleep() doug lkml
2014-02-27  2:55 ` Steven Rostedt
2014-02-27  3:37   ` doug lkml
2014-02-27  3:50     ` Steven Rostedt
2014-02-27  4:18       ` doug lkml

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).