diff options
| -rw-r--r-- | Documentation/RCU/RTFP.txt | 77 | ||||
| -rw-r--r-- | Documentation/RCU/UP.txt | 34 | ||||
| -rw-r--r-- | Documentation/RCU/checklist.txt | 20 | ||||
| -rw-r--r-- | Documentation/RCU/rcubarrier.txt | 7 | ||||
| -rw-r--r-- | Documentation/RCU/torture.txt | 23 | ||||
| -rw-r--r-- | Documentation/RCU/whatisRCU.txt | 14 |
6 files changed, 156 insertions, 19 deletions
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt index 9f711d2df91b..d2b85237c76e 100644 --- a/Documentation/RCU/RTFP.txt +++ b/Documentation/RCU/RTFP.txt | |||
| @@ -743,3 +743,80 @@ Revised: | |||
| 743 | RCU, realtime RCU, sleepable RCU, performance. | 743 | RCU, realtime RCU, sleepable RCU, performance. |
| 744 | " | 744 | " |
| 745 | } | 745 | } |
| 746 | |||
| 747 | @article{PaulEMcKenney2008RCUOSR | ||
| 748 | ,author="Paul E. McKenney and Jonathan Walpole" | ||
| 749 | ,title="Introducing technology into the {Linux} kernel: a case study" | ||
| 750 | ,Year="2008" | ||
| 751 | ,journal="SIGOPS Oper. Syst. Rev." | ||
| 752 | ,volume="42" | ||
| 753 | ,number="5" | ||
| 754 | ,pages="4--17" | ||
| 755 | ,issn="0163-5980" | ||
| 756 | ,doi={http://doi.acm.org/10.1145/1400097.1400099} | ||
| 757 | ,publisher="ACM" | ||
| 758 | ,address="New York, NY, USA" | ||
| 759 | ,annotation={ | ||
| 760 | Linux changed RCU to a far greater degree than RCU has changed Linux. | ||
| 761 | } | ||
| 762 | } | ||
| 763 | |||
| 764 | @unpublished{PaulEMcKenney2008HierarchicalRCU | ||
| 765 | ,Author="Paul E. McKenney" | ||
| 766 | ,Title="Hierarchical {RCU}" | ||
| 767 | ,month="November" | ||
| 768 | ,day="3" | ||
| 769 | ,year="2008" | ||
| 770 | ,note="Available: | ||
| 771 | \url{http://lwn.net/Articles/305782/} | ||
| 772 | [Viewed November 6, 2008]" | ||
| 773 | ,annotation=" | ||
| 774 | RCU with combining-tree-based grace-period detection, | ||
| 775 | permitting it to handle thousands of CPUs. | ||
| 776 | " | ||
| 777 | } | ||
| 778 | |||
| 779 | @conference{PaulEMcKenney2009MaliciousURCU | ||
| 780 | ,Author="Paul E. McKenney" | ||
| 781 | ,Title="Using a Malicious User-Level {RCU} to Torture {RCU}-Based Algorithms" | ||
| 782 | ,Booktitle="linux.conf.au 2009" | ||
| 783 | ,month="January" | ||
| 784 | ,year="2009" | ||
| 785 | ,address="Hobart, Australia" | ||
| 786 | ,note="Available: | ||
| 787 | \url{http://www.rdrop.com/users/paulmck/RCU/urcutorture.2009.01.22a.pdf} | ||
| 788 | [Viewed February 2, 2009]" | ||
| 789 | ,annotation=" | ||
| 790 | Realtime RCU and torture-testing RCU uses. | ||
| 791 | " | ||
| 792 | } | ||
| 793 | |||
| 794 | @unpublished{MathieuDesnoyers2009URCU | ||
| 795 | ,Author="Mathieu Desnoyers" | ||
| 796 | ,Title="[{RFC} git tree] Userspace {RCU} (urcu) for {Linux}" | ||
| 797 | ,month="February" | ||
| 798 | ,day="5" | ||
| 799 | ,year="2009" | ||
| 800 | ,note="Available: | ||
| 801 | \url{http://lkml.org/lkml/2009/2/5/572} | ||
| 802 | \url{git://lttng.org/userspace-rcu.git} | ||
| 803 | [Viewed February 20, 2009]" | ||
| 804 | ,annotation=" | ||
| 805 | Mathieu Desnoyers's user-space RCU implementation. | ||
| 806 | git://lttng.org/userspace-rcu.git | ||
| 807 | " | ||
| 808 | } | ||
| 809 | |||
| 810 | @unpublished{PaulEMcKenney2009BloatWatchRCU | ||
| 811 | ,Author="Paul E. McKenney" | ||
| 812 | ,Title="{RCU}: The {Bloatwatch} Edition" | ||
| 813 | ,month="March" | ||
| 814 | ,day="17" | ||
| 815 | ,year="2009" | ||
| 816 | ,note="Available: | ||
| 817 | \url{http://lwn.net/Articles/323929/} | ||
| 818 | [Viewed March 20, 2009]" | ||
| 819 | ,annotation=" | ||
| 820 | Uniprocessor assumptions allow simplified RCU implementation. | ||
| 821 | " | ||
| 822 | } | ||
diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt index aab4a9ec3931..90ec5341ee98 100644 --- a/Documentation/RCU/UP.txt +++ b/Documentation/RCU/UP.txt | |||
| @@ -2,14 +2,13 @@ RCU on Uniprocessor Systems | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | A common misconception is that, on UP systems, the call_rcu() primitive | 4 | A common misconception is that, on UP systems, the call_rcu() primitive |
| 5 | may immediately invoke its function, and that the synchronize_rcu() | 5 | may immediately invoke its function. The basis of this misconception |
| 6 | primitive may return immediately. The basis of this misconception | ||
| 7 | is that since there is only one CPU, it should not be necessary to | 6 | is that since there is only one CPU, it should not be necessary to |
| 8 | wait for anything else to get done, since there are no other CPUs for | 7 | wait for anything else to get done, since there are no other CPUs for |
| 9 | anything else to be happening on. Although this approach will -sort- -of- | 8 | anything else to be happening on. Although this approach will -sort- -of- |
| 10 | work a surprising amount of the time, it is a very bad idea in general. | 9 | work a surprising amount of the time, it is a very bad idea in general. |
| 11 | This document presents three examples that demonstrate exactly how bad an | 10 | This document presents three examples that demonstrate exactly how bad |
| 12 | idea this is. | 11 | an idea this is. |
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | Example 1: softirq Suicide | 14 | Example 1: softirq Suicide |
| @@ -82,11 +81,18 @@ Quick Quiz #2: What locking restriction must RCU callbacks respect? | |||
| 82 | 81 | ||
| 83 | Summary | 82 | Summary |
| 84 | 83 | ||
| 85 | Permitting call_rcu() to immediately invoke its arguments or permitting | 84 | Permitting call_rcu() to immediately invoke its arguments breaks RCU, |
| 86 | synchronize_rcu() to immediately return breaks RCU, even on a UP system. | 85 | even on a UP system. So do not do it! Even on a UP system, the RCU |
| 87 | So do not do it! Even on a UP system, the RCU infrastructure -must- | 86 | infrastructure -must- respect grace periods, and -must- invoke callbacks |
| 88 | respect grace periods, and -must- invoke callbacks from a known environment | 87 | from a known environment in which no locks are held. |
| 89 | in which no locks are held. | 88 | |
| 89 | It -is- safe for synchronize_sched() and synchronize_rcu_bh() to return | ||
| 90 | immediately on an UP system. It is also safe for synchronize_rcu() | ||
| 91 | to return immediately on UP systems, except when running preemptable | ||
| 92 | RCU. | ||
| 93 | |||
| 94 | Quick Quiz #3: Why can't synchronize_rcu() return immediately on | ||
| 95 | UP systems running preemptable RCU? | ||
| 90 | 96 | ||
| 91 | 97 | ||
| 92 | Answer to Quick Quiz #1: | 98 | Answer to Quick Quiz #1: |
| @@ -117,3 +123,13 @@ Answer to Quick Quiz #2: | |||
| 117 | callbacks acquire locks directly. However, a great many RCU | 123 | callbacks acquire locks directly. However, a great many RCU |
| 118 | callbacks do acquire locks -indirectly-, for example, via | 124 | callbacks do acquire locks -indirectly-, for example, via |
| 119 | the kfree() primitive. | 125 | the kfree() primitive. |
| 126 | |||
| 127 | Answer to Quick Quiz #3: | ||
| 128 | Why can't synchronize_rcu() return immediately on UP systems | ||
| 129 | running preemptable RCU? | ||
| 130 | |||
| 131 | Because some other task might have been preempted in the middle | ||
| 132 | of an RCU read-side critical section. If synchronize_rcu() | ||
| 133 | simply immediately returned, it would prematurely signal the | ||
| 134 | end of the grace period, which would come as a nasty shock to | ||
| 135 | that other thread when it started running again. | ||
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index accfe2f5247d..51525a30e8b4 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
| @@ -11,7 +11,10 @@ over a rather long period of time, but improvements are always welcome! | |||
| 11 | structure is updated more than about 10% of the time, then | 11 | structure is updated more than about 10% of the time, then |
| 12 | you should strongly consider some other approach, unless | 12 | you should strongly consider some other approach, unless |
| 13 | detailed performance measurements show that RCU is nonetheless | 13 | detailed performance measurements show that RCU is nonetheless |
| 14 | the right tool for the job. | 14 | the right tool for the job. Yes, you might think of RCU |
| 15 | as simply cutting overhead off of the readers and imposing it | ||
| 16 | on the writers. That is exactly why normal uses of RCU will | ||
| 17 | do much more reading than updating. | ||
| 15 | 18 | ||
| 16 | Another exception is where performance is not an issue, and RCU | 19 | Another exception is where performance is not an issue, and RCU |
| 17 | provides a simpler implementation. An example of this situation | 20 | provides a simpler implementation. An example of this situation |
| @@ -240,10 +243,11 @@ over a rather long period of time, but improvements are always welcome! | |||
| 240 | instead need to use synchronize_irq() or synchronize_sched(). | 243 | instead need to use synchronize_irq() or synchronize_sched(). |
| 241 | 244 | ||
| 242 | 12. Any lock acquired by an RCU callback must be acquired elsewhere | 245 | 12. Any lock acquired by an RCU callback must be acquired elsewhere |
| 243 | with irq disabled, e.g., via spin_lock_irqsave(). Failing to | 246 | with softirq disabled, e.g., via spin_lock_irqsave(), |
| 244 | disable irq on a given acquisition of that lock will result in | 247 | spin_lock_bh(), etc. Failing to disable irq on a given |
| 245 | deadlock as soon as the RCU callback happens to interrupt that | 248 | acquisition of that lock will result in deadlock as soon as the |
| 246 | acquisition's critical section. | 249 | RCU callback happens to interrupt that acquisition's critical |
| 250 | section. | ||
| 247 | 251 | ||
| 248 | 13. RCU callbacks can be and are executed in parallel. In many cases, | 252 | 13. RCU callbacks can be and are executed in parallel. In many cases, |
| 249 | the callback code simply wrappers around kfree(), so that this | 253 | the callback code simply wrappers around kfree(), so that this |
| @@ -310,3 +314,9 @@ over a rather long period of time, but improvements are always welcome! | |||
| 310 | Because these primitives only wait for pre-existing readers, | 314 | Because these primitives only wait for pre-existing readers, |
| 311 | it is the caller's responsibility to guarantee safety to | 315 | it is the caller's responsibility to guarantee safety to |
| 312 | any subsequent readers. | 316 | any subsequent readers. |
| 317 | |||
| 318 | 16. The various RCU read-side primitives do -not- contain memory | ||
| 319 | barriers. The CPU (and in some cases, the compiler) is free | ||
| 320 | to reorder code into and out of RCU read-side critical sections. | ||
| 321 | It is the responsibility of the RCU update-side primitives to | ||
