Split PREEMPT_RCU implementation into separate rcupreempt.c
PATCH 1/1 Split PREEMPT_RCU implementation into separate rcupreempt.c
Hello!
This patch splits the PREEMPT_RCU implementation out from rcupdate.c into a separate rcupreempt.c, and creates an rcucommon.h containing common code (e.g., synchronize_rcu()). I should have done this long ago to reduce both confusion and the number of #ifdefs in rcupdate.c!
---
Kconfig.preempt | 17 + Makefile | 4 rcucommon.h | 83 +++++++++ rcupdate.c | 475 ------------------------------------------------------ rcupreempt.c | 486 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 590 insertions(+), 475 deletions(-)
kernel/Kconfig.preempt +16 -1
@@ -138,9 +138,22 @@ config PREEMPT_BKL default n if !PREEMPT default y +choice + prompt "RCU implementation type:" + default PREEMPT_RCU if PREEMPT_RT + default CLASSIC_RCU + +config CLASSIC_RCU + bool "Classic RCU" + help + This option selects the classic RCU implementation that is + designed for best read-side performance on non-embedded + machines. + + Say Y if you are unsure. + config PREEMPT_RCU bool "Preemptible RCU" - default n depends on PREEMPT help This option reduces the latency of the kernel by making certain
@@ -152,6 +165,8 @@ config PREEMPT_RCU Say N if you are unsure. +endchoice + config RCU_STATS bool "/proc stats for preemptible RCU read-side critical sections" depends on PREEMPT_RCU
kernel/Makefile +3 -1
@@ -6,7 +6,7 @@ obj-y = sched.o fork.o exec_domain.o exit.o itimer.o time.o softirq.o resource.o \ sysctl.o capability.o ptrace.o timer.o user.o \ signal.o sys.o kmod.o workqueue.o pid.o \ - rcupdate.o intermodule.o extable.o params.o posix-timers.o \ + intermodule.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o \ hrtimer.o rt.o
@@ -38,6 +38,8 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o +obj-$(CONFIG_CLASSIC_RCU) += rcupdate.o +obj-$(CONFIG_PREEMPT_RCU) += rcupreempt.o ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y) # According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is
kernel/rcucommon.h +83 -0
83 lines not on this page · raw message
kernel/rcupdate.c +2 -473
504 lines not on this page · raw message
kernel/rcupreempt.c +486 -0
486 lines not on this page · raw message
Quoted 8 lines · Paul E. McKenney
Hello!
This patch splits the
PREEMPT_RCUimplementation out fromrcupdate.cinto a separatercupreempt.c, and creates anrcucommon.hcontaining common code (e.g.,synchronize_rcu()). I should have done this long ago to reduce both confusion and the number of #ifdefs inrcupdate.c!Signed-off-by <[email protected]>
great - i've applied this, and it looks much cleaner now.
Ingo