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 /kernel/fork.c | |
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 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 021e1138556..642e8b5edf0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1022,10 +1022,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1022 | copy_flags(clone_flags, p); | 1022 | copy_flags(clone_flags, p); |
1023 | INIT_LIST_HEAD(&p->children); | 1023 | INIT_LIST_HEAD(&p->children); |
1024 | INIT_LIST_HEAD(&p->sibling); | 1024 | INIT_LIST_HEAD(&p->sibling); |
1025 | #ifdef CONFIG_PREEMPT_RCU | 1025 | rcu_copy_process(p); |
1026 | p->rcu_read_lock_nesting = 0; | ||
1027 | p->rcu_flipctr_idx = 0; | ||
1028 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | ||
1029 | p->vfork_done = NULL; | 1026 | p->vfork_done = NULL; |
1030 | spin_lock_init(&p->alloc_lock); | 1027 | spin_lock_init(&p->alloc_lock); |
1031 | 1028 | ||