Commit a4b57562 authored by Paul E. McKenney's avatar Paul E. McKenney

documentation: Expand on scheduler/RCU deadlock requirements

This commit adds a second option for avoiding scheduler/RCU deadlocks,
namely that preemption be disabled across the entire RCU read-side
critical section in question.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 0825458b
...@@ -1942,12 +1942,16 @@ RCU depends on the scheduler, and the scheduler uses RCU to ...@@ -1942,12 +1942,16 @@ RCU depends on the scheduler, and the scheduler uses RCU to
protect some of its data structures. protect some of its data structures.
This means the scheduler is forbidden from acquiring This means the scheduler is forbidden from acquiring
the runqueue locks and the priority-inheritance locks the runqueue locks and the priority-inheritance locks
in the middle of an outermost RCU read-side critical section unless in the middle of an outermost RCU read-side critical section unless either
it also releases them before exiting that same (1)&nbsp;it releases them before exiting that same
RCU read-side critical section. RCU read-side critical section, or
This same prohibition also applies to any lock that is acquired (2)&nbsp;preemption is disabled across
that entire RCU read-side critical section.
This same prohibition also applies (recursively!) to any lock that is acquired
while holding any lock to which this prohibition applies. while holding any lock to which this prohibition applies.
Violating this rule results in deadlock. Adhering to this rule prevents preemptible RCU from invoking
<tt>rcu_read_unlock_special()</tt> while either runqueue or
priority-inheritance locks are held, thus avoiding deadlock.
<p> <p>
For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt> For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt>
......
...@@ -2109,12 +2109,16 @@ RCU depends on the scheduler, and the scheduler uses RCU to ...@@ -2109,12 +2109,16 @@ RCU depends on the scheduler, and the scheduler uses RCU to
protect some of its data structures. protect some of its data structures.
This means the scheduler is forbidden from acquiring This means the scheduler is forbidden from acquiring
the runqueue locks and the priority-inheritance locks the runqueue locks and the priority-inheritance locks
in the middle of an outermost RCU read-side critical section unless in the middle of an outermost RCU read-side critical section unless either
it also releases them before exiting that same (1)&nbsp;it releases them before exiting that same
RCU read-side critical section. RCU read-side critical section, or
This same prohibition also applies to any lock that is acquired (2)&nbsp;preemption is disabled across
that entire RCU read-side critical section.
This same prohibition also applies (recursively!) to any lock that is acquired
while holding any lock to which this prohibition applies. while holding any lock to which this prohibition applies.
Violating this rule results in deadlock. Adhering to this rule prevents preemptible RCU from invoking
<tt>rcu_read_unlock_special()</tt> while either runqueue or
priority-inheritance locks are held, thus avoiding deadlock.
<p> <p>
For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt> For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment