doc: Remove obsolete (non-)requirement about disabling preemption
The Requirements.html document says "Disabling Preemption Does Not Block Grace Periods". However this is no longer true with the RCU consolidation. This commit therefore removes the obsolete (non-)requirement entirely. Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
This commit is contained in:
parent
93eb14201f
commit
8b9df28d7f
|
@ -900,8 +900,6 @@ Except where otherwise noted, these non-guarantees were premeditated.
|
|||
Grace Periods Don't Partition Read-Side Critical Sections</a>
|
||||
<li> <a href="#Read-Side Critical Sections Don't Partition Grace Periods">
|
||||
Read-Side Critical Sections Don't Partition Grace Periods</a>
|
||||
<li> <a href="#Disabling Preemption Does Not Block Grace Periods">
|
||||
Disabling Preemption Does Not Block Grace Periods</a>
|
||||
</ol>
|
||||
|
||||
<h3><a name="Readers Impose Minimal Ordering">Readers Impose Minimal Ordering</a></h3>
|
||||
|
@ -1259,54 +1257,6 @@ of RCU grace periods.
|
|||
<tr><td> </td></tr>
|
||||
</table>
|
||||
|
||||
<h3><a name="Disabling Preemption Does Not Block Grace Periods">
|
||||
Disabling Preemption Does Not Block Grace Periods</a></h3>
|
||||
|
||||
<p>
|
||||
There was a time when disabling preemption on any given CPU would block
|
||||
subsequent grace periods.
|
||||
However, this was an accident of implementation and is not a requirement.
|
||||
And in the current Linux-kernel implementation, disabling preemption
|
||||
on a given CPU in fact does not block grace periods, as Oleg Nesterov
|
||||
<a href="https://lkml.kernel.org/g/20150614193825.GA19582@redhat.com">demonstrated</a>.
|
||||
|
||||
<p>
|
||||
If you need a preempt-disable region to block grace periods, you need to add
|
||||
<tt>rcu_read_lock()</tt> and <tt>rcu_read_unlock()</tt>, for example
|
||||
as follows:
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
1 preempt_disable();
|
||||
2 rcu_read_lock();
|
||||
3 do_something();
|
||||
4 rcu_read_unlock();
|
||||
5 preempt_enable();
|
||||
6
|
||||
7 /* Spinlocks implicitly disable preemption. */
|
||||
8 spin_lock(&mylock);
|
||||
9 rcu_read_lock();
|
||||
10 do_something();
|
||||
11 rcu_read_unlock();
|
||||
12 spin_unlock(&mylock);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
In theory, you could enter the RCU read-side critical section first,
|
||||
but it is more efficient to keep the entire RCU read-side critical
|
||||
section contained in the preempt-disable region as shown above.
|
||||
Of course, RCU read-side critical sections that extend outside of
|
||||
preempt-disable regions will work correctly, but such critical sections
|
||||
can be preempted, which forces <tt>rcu_read_unlock()</tt> to do
|
||||
more work.
|
||||
And no, this is <i>not</i> an invitation to enclose all of your RCU
|
||||
read-side critical sections within preempt-disable regions, because
|
||||
doing so would degrade real-time response.
|
||||
|
||||
<p>
|
||||
This non-requirement appeared with preemptible RCU.
|
||||
|
||||
<h2><a name="Parallelism Facts of Life">Parallelism Facts of Life</a></h2>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue