Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcu: Make SRCU optional by using CONFIG_SRCU

SRCU is not necessary to be compiled by default in all cases. For tinification
efforts not compiling SRCU unless necessary is desirable.

The current patch tries to make compiling SRCU optional by introducing a new
Kconfig option CONFIG_SRCU which is selected when any of the components making
use of SRCU are selected.

If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.

text data bss dec hex filename
2007 0 0 2007 7d7 kernel/rcu/srcu.o

Size of arch/powerpc/boot/zImage changes from

text data bss dec hex filename
831552 64180 23944 919676 e087c arch/powerpc/boot/zImage : before
829504 64180 23952 917636 e0084 arch/powerpc/boot/zImage : after

so the savings are about ~2000 bytes.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
CC: Josh Triplett <josh@joshtriplett.org>
CC: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]

authored by

Pranith Kumar and committed by
Paul E. McKenney
83fe27ea 9735af5c

+34 -1
+1
arch/arm/kvm/Kconfig
··· 23 23 select HAVE_KVM_CPU_RELAX_INTERCEPT 24 24 select KVM_MMIO 25 25 select KVM_ARM_HOST 26 + select SRCU 26 27 depends on ARM_VIRT_EXT && ARM_LPAE 27 28 ---help--- 28 29 Support hosting virtualized guest machines. You will also
+1
arch/arm64/kvm/Kconfig
··· 26 26 select KVM_ARM_HOST 27 27 select KVM_ARM_VGIC 28 28 select KVM_ARM_TIMER 29 + select SRCU 29 30 ---help--- 30 31 Support hosting virtualized guest machines. 31 32
+1
arch/mips/kvm/Kconfig
··· 20 20 select PREEMPT_NOTIFIERS 21 21 select ANON_INODES 22 22 select KVM_MMIO 23 + select SRCU 23 24 ---help--- 24 25 Support for hosting Guest kernels. 25 26 Currently supported on MIPS32 processors.
+1
arch/powerpc/kvm/Kconfig
··· 21 21 select PREEMPT_NOTIFIERS 22 22 select ANON_INODES 23 23 select HAVE_KVM_EVENTFD 24 + select SRCU 24 25 25 26 config KVM_BOOK3S_HANDLER 26 27 bool
+1
arch/s390/kvm/Kconfig
··· 28 28 select HAVE_KVM_IRQCHIP 29 29 select HAVE_KVM_IRQFD 30 30 select HAVE_KVM_IRQ_ROUTING 31 + select SRCU 31 32 ---help--- 32 33 Support hosting paravirtualized guest machines using the SIE 33 34 virtualization capability on the mainframe. This should work
+1
arch/tile/kvm/Kconfig
··· 21 21 depends on HAVE_KVM && MODULES 22 22 select PREEMPT_NOTIFIERS 23 23 select ANON_INODES 24 + select SRCU 24 25 ---help--- 25 26 Support hosting paravirtualized guest machines. 26 27
+1
arch/x86/Kconfig
··· 138 138 select HAVE_ACPI_APEI_NMI if ACPI 139 139 select ACPI_LEGACY_TABLES_LOOKUP if ACPI 140 140 select X86_FEATURE_NAMES if PROC_FS 141 + select SRCU 141 142 142 143 config INSTRUCTION_DECODER 143 144 def_bool y
+1
arch/x86/kvm/Kconfig
··· 40 40 select HAVE_KVM_MSI 41 41 select HAVE_KVM_CPU_RELAX_INTERCEPT 42 42 select KVM_VFIO 43 + select SRCU 43 44 ---help--- 44 45 Support hosting fully virtualized guest machines using hardware 45 46 virtualization extensions. You will need a fairly recent
+1
drivers/clk/Kconfig
··· 13 13 bool 14 14 select HAVE_CLK_PREPARE 15 15 select CLKDEV_LOOKUP 16 + select SRCU 16 17 ---help--- 17 18 The common clock framework is a single definition of struct 18 19 clk, useful across many platforms, as well as an
+1
drivers/cpufreq/Kconfig
··· 2 2 3 3 config CPU_FREQ 4 4 bool "CPU Frequency scaling" 5 + select SRCU 5 6 help 6 7 CPU Frequency scaling allows you to change the clock speed of 7 8 CPUs on the fly. This is a nice method to save power, because
+1
drivers/devfreq/Kconfig
··· 1 1 menuconfig PM_DEVFREQ 2 2 bool "Generic Dynamic Voltage and Frequency Scaling (DVFS) support" 3 + select SRCU 3 4 help 4 5 A device may have a list of frequencies and voltages available. 5 6 devfreq, a generic DVFS framework can be registered for a device
+1
drivers/md/Kconfig
··· 5 5 menuconfig MD 6 6 bool "Multiple devices driver support (RAID and LVM)" 7 7 depends on BLOCK 8 + select SRCU 8 9 help 9 10 Support multiple physical spindles through a single logical device. 10 11 Required for RAID and logical volume management.
+1
drivers/net/Kconfig
··· 197 197 198 198 config NETPOLL 199 199 def_bool NETCONSOLE 200 + select SRCU 200 201 201 202 config NET_POLL_CONTROLLER 202 203 def_bool NETPOLL
+1
fs/btrfs/Kconfig
··· 8 8 select LZO_DECOMPRESS 9 9 select RAID6_PQ 10 10 select XOR_BLOCKS 11 + select SRCU 11 12 12 13 help 13 14 Btrfs is a general purpose copy-on-write filesystem with extents,
+1
fs/notify/Kconfig
··· 1 1 config FSNOTIFY 2 2 def_bool n 3 + select SRCU 3 4 4 5 source "fs/notify/dnotify/Kconfig" 5 6 source "fs/notify/inotify/Kconfig"
+1
fs/quota/Kconfig
··· 5 5 config QUOTA 6 6 bool "Quota support" 7 7 select QUOTACTL 8 + select SRCU 8 9 help 9 10 If you say Y here, you will be able to set per user limits for disk 10 11 usage (also called disk quotas). Currently, it works for the
+9
init/Kconfig
··· 501 501 502 502 endchoice 503 503 504 + config SRCU 505 + bool 506 + help 507 + This option selects the sleepable version of RCU. This version 508 + permits arbitrary sleeping or blocking within RCU read-side critical 509 + sections. 510 + 504 511 config TASKS_RCU 505 512 bool "Task_based RCU implementation using voluntary context switch" 506 513 default n 514 + select SRCU 507 515 help 508 516 This option enables a task-based RCU implementation that uses 509 517 only voluntary context switch (not preemption!), idle, and ··· 1603 1595 depends on HAVE_PERF_EVENTS 1604 1596 select ANON_INODES 1605 1597 select IRQ_WORK 1598 + select SRCU 1606 1599 help 1607 1600 Enable kernel support for various performance events provided 1608 1601 by software and hardware.
+3
kernel/notifier.c
··· 402 402 } 403 403 EXPORT_SYMBOL_GPL(raw_notifier_call_chain); 404 404 405 + #ifdef CONFIG_SRCU 405 406 /* 406 407 * SRCU notifier chain routines. Registration and unregistration 407 408 * use a mutex, and call_chain is synchronized by SRCU (no locks). ··· 528 527 nh->head = NULL; 529 528 } 530 529 EXPORT_SYMBOL_GPL(srcu_init_notifier_head); 530 + 531 + #endif /* CONFIG_SRCU */ 531 532 532 533 static ATOMIC_NOTIFIER_HEAD(die_chain); 533 534
+1
kernel/power/Kconfig
··· 251 251 252 252 config PM_OPP 253 253 bool 254 + select SRCU 254 255 ---help--- 255 256 SOCs have a standard set of tuples consisting of frequency and 256 257 voltage pairs that the device will support per voltage domain. This
+2 -1
kernel/rcu/Makefile
··· 1 - obj-y += update.o srcu.o 1 + obj-y += update.o 2 + obj-$(CONFIG_SRCU) += srcu.o 2 3 obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o 3 4 obj-$(CONFIG_TREE_RCU) += tree.o 4 5 obj-$(CONFIG_PREEMPT_RCU) += tree.o
+1
lib/Kconfig.debug
··· 1215 1215 tristate "torture tests for RCU" 1216 1216 depends on DEBUG_KERNEL 1217 1217 select TORTURE_TEST 1218 + select SRCU 1218 1219 default n 1219 1220 help 1220 1221 This option provides a kernel module that runs torture tests
+1
mm/Kconfig
··· 325 325 326 326 config MMU_NOTIFIER 327 327 bool 328 + select SRCU 328 329 329 330 config KSM 330 331 bool "Enable KSM for page merging"
+1
security/tomoyo/Kconfig
··· 5 5 select SECURITYFS 6 6 select SECURITY_PATH 7 7 select SECURITY_NETWORK 8 + select SRCU 8 9 default n 9 10 help 10 11 This selects TOMOYO Linux, pathname-based access control.