diff options
author | Paul E. McKenney <paulmck@us.ibm.com> | 2006-10-04 05:17:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:30 -0400 |
commit | 621934ee7ed5b073c7fd638b347e632c53572761 (patch) | |
tree | 5722f9cda22c099ad60545f963410dcbc762ee65 /Documentation/RCU/whatisRCU.txt | |
parent | 95d77884c77beed676036d2f74d10b470a483c63 (diff) |
[PATCH] srcu-3: RCU variant permitting read-side blocking
Updated patch adding a variant of RCU that permits sleeping in read-side
critical sections. SRCU is as follows:
o Each use of SRCU creates its own srcu_struct, and each
srcu_struct has its own set of grace periods. This is
critical, as it prevents one subsystem with a blocking
reader from holding up SRCU grace periods for other
subsystems.
o The SRCU primitives (srcu_read_lock(), srcu_read_unlock(),
and synchronize_srcu()) all take a pointer to a srcu_struct.
o The SRCU primitives must be called from process context.
o srcu_read_lock() returns an int that must be passed to
the matching srcu_read_unlock(). Realtime RCU avoids the
need for this by storing the state in the task struct,
but SRCU needs to allow a given code path to pass through
multiple SRCU domains -- storing state in the task struct
would therefore require either arbitrary space in the
task struct or arbitrary limits on SRCU nesting. So I
kicked the state-storage problem up to the caller.
Of course, it is not permitted to call synchronize_srcu()
while in an SRCU read-side critical section.
o There is no call_srcu(). It would not be hard to implement
one, but it seems like too easy a way to OOM the system.
(Hey, we have enough trouble with call_rcu(), which does
-not- permit readers to sleep!!!) So, if you want it,
please tell me why...
[josht@us.ibm.com: sparse notation]
Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation/RCU/whatisRCU.txt')
-rw-r--r-- | Documentation/RCU/whatisRCU.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 820fee236967..e0d6d99b8f9b 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -778,6 +778,8 @@ Markers for RCU read-side critical sections: | |||
778 | rcu_read_unlock | 778 | rcu_read_unlock |
779 | rcu_read_lock_bh | 779 | rcu_read_lock_bh |
780 | rcu_read_unlock_bh | 780 | rcu_read_unlock_bh |
781 | srcu_read_lock | ||
782 | srcu_read_unlock | ||
781 | 783 | ||
782 | RCU pointer/list traversal: | 784 | RCU pointer/list traversal: |
783 | 785 | ||
@@ -804,6 +806,7 @@ RCU grace period: | |||
804 | synchronize_net | 806 | synchronize_net |
805 | synchronize_sched | 807 | synchronize_sched |
806 | synchronize_rcu | 808 | synchronize_rcu |
809 | synchronize_srcu | ||
807 | call_rcu | 810 | call_rcu |
808 | call_rcu_bh | 811 | call_rcu_bh |
809 | 812 | ||