diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2009-08-22 16:56:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-23 04:32:40 -0400 |
commit | f41d911f8c49a5d65c86504c19e8204bb605c4fd (patch) | |
tree | 59bcd3048652ef290b3e19d2904409afd5c90eb3 /include/linux/rcutree.h | |
parent | a157229cabd6dd8cfa82525fc9bf730c94cc9ac2 (diff) |
rcu: Merge preemptable-RCU functionality into hierarchical RCU
Create a kernel/rcutree_plugin.h file that contains definitions
for preemptable RCU (or, under the #else branch of the #ifdef,
empty definitions for the classic non-preemptable semantics).
These definitions fit into plugins defined in kernel/rcutree.c
for this purpose.
This variant of preemptable RCU uses a new algorithm whose
read-side expense is roughly that of classic hierarchical RCU
under CONFIG_PREEMPT. This new algorithm's update-side expense
is similar to that of classic hierarchical RCU, and, in absence
of read-side preemption or blocking, is exactly that of classic
hierarchical RCU. Perhaps more important, this new algorithm
has a much simpler implementation, saving well over 1,000 lines
of code compared to mainline's implementation of preemptable
RCU, which will hopefully be retired in favor of this new
algorithm.
The simplifications are obtained by maintaining per-task
nesting state for running tasks, and using a simple
lock-protected algorithm to handle accounting when tasks block
within RCU read-side critical sections, making use of lessons
learned while creating numerous user-level RCU implementations
over the past 18 months.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: josht@linux.vnet.ibm.com
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
LKML-Reference: <12509746134003-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/rcutree.h')
-rw-r--r-- | include/linux/rcutree.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index c739d90f5e68..a89307717825 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -35,14 +35,30 @@ extern void rcu_bh_qs(int cpu); | |||
35 | 35 | ||
36 | extern int rcu_needs_cpu(int cpu); | 36 | extern int rcu_needs_cpu(int cpu); |
37 | 37 | ||
38 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
39 | |||
40 | extern void __rcu_read_lock(void); | ||
41 | extern void __rcu_read_unlock(void); | ||
42 | extern void exit_rcu(void); | ||
43 | |||
44 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
45 | |||
38 | static inline void __rcu_read_lock(void) | 46 | static inline void __rcu_read_lock(void) |
39 | { | 47 | { |
40 | preempt_disable(); | 48 | preempt_disable(); |
41 | } | 49 | } |
50 | |||
42 | static inline void __rcu_read_unlock(void) | 51 | static inline void __rcu_read_unlock(void) |
43 | { | 52 | { |
44 | preempt_enable(); | 53 | preempt_enable(); |
45 | } | 54 | } |
55 | |||
56 | static inline void exit_rcu(void) | ||
57 | { | ||
58 | } | ||
59 | |||
60 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
61 | |||
46 | static inline void __rcu_read_lock_bh(void) | 62 | static inline void __rcu_read_lock_bh(void) |
47 | { | 63 | { |
48 | local_bh_disable(); | 64 | local_bh_disable(); |