[PATCH RFC -tip 0/4] v3 RCU cleanups and simplified preemptable RCU

From: Paul E. McKenney
Date: Sat Aug 22 2009 - 16:52:49 EST


[Not yet for inclusion, but continuing to make good progress.]

This patchset contains some RCU cleanups as follows:

o Move private definitions from include/linux/rcutree.h to
kernel/rcutree.h

o Rename variables and functions so that RCU-sched is an
underlying definition, along with RCU-bh and (when so
configured) RCU-preempt. RCU then maps to either RCU-sched
or RCU-preempt, depending on configuration.

o Consolidate sparse and lockdep into include/linux/rcupdate.h
so that all RCU implementations are set up properly.

o Fix a tracing error that reversed CPU online/offline indication.

o Since we need a macro for part of the per-RCU-flavor
initialization, save some code by putting all of this
per-RCU-flavor initialization into that macro.

o Use the debugfs_remove_recursive() primitive to simplify
debugfs tracing cleanup.

o Merge the old rcu_pending() API into the remaining
rcu_check_callbacks() API.

With these in place, we add configurable preemptable-RCU functionality
to kernel/rcutree.c. This new implementation has much faster and
simpler read-side primitives (roughly that of Classic RCU built with
CONFIG_PREEMPT), and has update-side performance equal to Classic RCU
(at least in absence of blocking or preemption of RCU read-side critical
sections). Finally, we ditch the old preemptable RCU, for an overall
net removal of more than 1,000 lines of code. Of course, Murphy being
who he is, this savings will no doubt shrink a bit as debugging continues.

This patchset is undoubtably buggy, and does not have RCU priority
boosting, though it does have the necessary tracking of tasks blocked
in RCU read-side critical sections. CONFIG_TREE_PREEMPT_RCU still
has hotplug-RCU issues above and beyond those that may exist with
CONFIG_TREE_RCU.

Changes from v2 (http://lkml.org/lkml/2009/7/27/274):

o Rebase to current tip/core/rcu

o Test on a wide variety of CONFIG options, cleaning up build
errors. Believed to be a sufficient set of CONFIG options,
but judge for yourself:

http://www.rdrop.com/users/paulmck/patches/configs/rcutreepreempt

The "config" file contains the rationale for the selection, the
"0-smoketest" file contains the config options I was testing the
earlier versions of this patchset against, and the rest of the
files contain the config options that the current patchset was
tested against.

o Added patch to remove CONFIG_PREEMPT_RCU.

Changes from v1 (http://lkml.org/lkml/2009/7/23/294):

o Fixes some locking problems detected by lockdep.

o Disable irqs in quiescent-state-detection code, and fix handling
of scheduling-clock interrupt always occurring in RCU read-side
critical section.

o Fix sparse annotations.

o Apply feedback from Mathieu Desnoyers.

o Fix x86 kernel-build errors.

o Now passes moderate (multi-hour) rcutorture tests.

Shortcomings:

o Only moderately tested, probably still quite buggy. CPU hotplug
being one example.

o Lacks RCU priority boosting.

o Lacks expedited RCU grace periods for CONFIG_TREE_PREEMPT_RCU.

b/Documentation/RCU/rcu.txt | 10
b/Documentation/RCU/trace.txt | 7
b/Documentation/RCU/whatisRCU.txt | 8
b/arch/ia64/xen/time.c | 3
b/include/linux/init_task.h | 11
b/include/linux/rcupdate.h | 73 +
b/include/linux/rcutree.h | 250 ------
b/include/linux/sched.h | 30
b/init/Kconfig | 34
b/kernel/Makefile | 3
b/kernel/exit.c | 1
b/kernel/fork.c | 5
b/kernel/rcutree.c | 194 +++-
b/kernel/rcutree.h | 251 ++++++
b/kernel/rcutree_plugin.h | 447 +++++++++++
b/kernel/rcutree_trace.c | 88 +-
b/kernel/sched.c | 2
b/kernel/softirq.c | 4
b/kernel/timer.c | 3
include/linux/rcupreempt.h | 137 ---
include/linux/rcupreempt_trace.h | 97 --
kernel/rcupreempt.c | 1512 --------------------------------------
kernel/rcupreempt_trace.c | 335 --------
lib/Kconfig.debug | 2
24 files changed, 1026 insertions(+), 2481 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/