Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locking/rt: Take RCU nesting into account for might_sleep()
The RT patches contained a cheap hack to ignore the RCU nesting depth in might_sleep() checks, which was a pragmatic but incorrect workaround. The general rule that rcu_read_lock() held sections cannot voluntary sleep does apply even on RT kernels. Though the substitution of spin/rw locks on RT enabled kernels has to be exempt from that rule. On !RT a spin_lock() can obviously nest inside a rcu read side critical section as the lock acquisition is not going to block, but on RT this is not longer the case due to the 'sleeping' spin lock substitution. Instead of generally ignoring the RCU nesting depth in might_sleep() checks, pass the rcu_preempt_depth() as offset argument to might_sleep() from spin/read/write_lock() which makes the check work correctly even in RCU read side critical sections. The actual blocking on such a substituted lock within a RCU read side critical section is already handled correctly in __schedule() by treating it as a "preemption" of the RCU read side critical section. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- Loading branch information