Skip to content

Commit

Permalink
documentation: Expand on scheduler/RCU deadlock requirements
Browse files Browse the repository at this point in the history
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: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmck committed Dec 5, 2015
1 parent 0825458 commit a4b5756
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions Documentation/RCU/Design/Requirements/Requirements.html
Original file line number Diff line number Diff line change
Expand Up @@ -1942,12 +1942,16 @@ <h3><a name="Scheduler and RCU">Scheduler and RCU</a></h3>
protect some of its data structures.
This means the scheduler is forbidden from acquiring
the runqueue locks and the priority-inheritance locks
in the middle of an outermost RCU read-side critical section unless
it also releases them before exiting that same
RCU read-side critical section.
This same prohibition also applies to any lock that is acquired
in the middle of an outermost RCU read-side critical section unless either
(1)&nbsp;it releases them before exiting that same
RCU read-side critical section, or
(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.
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>
For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt>
Expand Down
14 changes: 9 additions & 5 deletions Documentation/RCU/Design/Requirements/Requirements.htmlx
Original file line number Diff line number Diff line change
Expand Up @@ -2109,12 +2109,16 @@ RCU depends on the scheduler, and the scheduler uses RCU to
protect some of its data structures.
This means the scheduler is forbidden from acquiring
the runqueue locks and the priority-inheritance locks
in the middle of an outermost RCU read-side critical section unless
it also releases them before exiting that same
RCU read-side critical section.
This same prohibition also applies to any lock that is acquired
in the middle of an outermost RCU read-side critical section unless either
(1)&nbsp;it releases them before exiting that same
RCU read-side critical section, or
(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.
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>
For RCU's part, the preemptible-RCU <tt>rcu_read_unlock()</tt>
Expand Down

0 comments on commit a4b5756

Please sign in to comment.