diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-10-07 13:33:24 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-11-14 13:39:36 -0500 |
commit | e2c85cb12c86b080ee344928618eb918fa227ac8 (patch) | |
tree | 1f28cd6ca649e4080176b9f0d15e9f6cb3c2bb55 | |
parent | 1001354ca34179f3db924eb66672442a173147dc (diff) |
documentation: Present updated RCU guarantee
Recent memory-model work deduces the relationships of RCU read-side
critical sections and grace periods based on the relationships of
accesses within a critical section and accesses preceding and following
the grace period. This commit therefore adds this viewpoint.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | Documentation/RCU/Design/Requirements/Requirements.html | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Documentation/RCU/Design/Requirements/Requirements.html b/Documentation/RCU/Design/Requirements/Requirements.html index a4d3838130e4..39bcb74ea733 100644 --- a/Documentation/RCU/Design/Requirements/Requirements.html +++ b/Documentation/RCU/Design/Requirements/Requirements.html | |||
@@ -547,7 +547,7 @@ The <tt>rcu_access_pointer()</tt> on line 6 is similar to | |||
547 | It could reuse a value formerly fetched from this same pointer. | 547 | It could reuse a value formerly fetched from this same pointer. |
548 | It could also fetch the pointer from <tt>gp</tt> in a byte-at-a-time | 548 | It could also fetch the pointer from <tt>gp</tt> in a byte-at-a-time |
549 | manner, resulting in <i>load tearing</i>, in turn resulting a bytewise | 549 | manner, resulting in <i>load tearing</i>, in turn resulting a bytewise |
550 | mash-up of two distince pointer values. | 550 | mash-up of two distinct pointer values. |
551 | It might even use value-speculation optimizations, where it makes | 551 | It might even use value-speculation optimizations, where it makes |
552 | a wrong guess, but by the time it gets around to checking the | 552 | a wrong guess, but by the time it gets around to checking the |
553 | value, an update has changed the pointer to match the wrong guess. | 553 | value, an update has changed the pointer to match the wrong guess. |
@@ -659,6 +659,29 @@ systems with more than one CPU: | |||
659 | In other words, a given instance of <tt>synchronize_rcu()</tt> | 659 | In other words, a given instance of <tt>synchronize_rcu()</tt> |
660 | can avoid waiting on a given RCU read-side critical section only | 660 | can avoid waiting on a given RCU read-side critical section only |
661 | if it can prove that <tt>synchronize_rcu()</tt> started first. | 661 | if it can prove that <tt>synchronize_rcu()</tt> started first. |
662 | |||
663 | <p> | ||
664 | A related question is “When <tt>rcu_read_lock()</tt> | ||
665 | doesn't generate any code, why does it matter how it relates | ||
666 | to a grace period?” | ||
667 | The answer is that it is not the relationship of | ||
668 | <tt>rcu_read_lock()</tt> itself that is important, but rather | ||
669 | the relationship of the code within the enclosed RCU read-side | ||
670 | critical section to the code preceding and following the | ||
671 | grace period. | ||
672 | If we take this viewpoint, then a given RCU read-side critical | ||
673 | section begins before a given grace period when some access | ||
674 | preceding the grace period observes the effect of some access | ||
675 | within the critical section, in which case none of the accesses | ||
676 | within the critical section may observe the effects of any | ||
677 | access following the grace period. | ||
678 | |||
679 | <p> | ||
680 | As of late 2016, mathematical models of RCU take this | ||
681 | viewpoint, for example, see slides 62 and 63 | ||
682 | of the | ||
683 | <a href="http://www2.rdrop.com/users/paulmck/scalability/paper/LinuxMM.2016.10.04c.LCE.pdf">2016 LinuxCon EU</a> | ||
684 | presentation. | ||
662 | </font></td></tr> | 685 | </font></td></tr> |
663 | <tr><td> </td></tr> | 686 | <tr><td> </td></tr> |
664 | </table> | 687 | </table> |