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

Configure Feed

Select the types of activity you want to include in your feed.

rcu: Provide a boot time parameter to control lazy RCU

To allow more flexible arrangements while still provide a single kernel
for distros, provide a boot time parameter to enable/disable lazy RCU.

Specify:

rcutree.enable_rcu_lazy=[y|1|n|0]

Which also requires

rcu_nocbs=all

at boot time to enable/disable lazy RCU.

To disable it by default at build time when CONFIG_RCU_LAZY=y, the new
CONFIG_RCU_LAZY_DEFAULT_OFF can be used.

Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>

authored by

Qais Yousef and committed by
Boqun Feng
7f66f099 499d7e7e

+24 -1
+5
Documentation/admin-guide/kernel-parameters.txt
··· 5034 5034 this kernel boot parameter, forcibly setting it 5035 5035 to zero. 5036 5036 5037 + rcutree.enable_rcu_lazy= [KNL] 5038 + To save power, batch RCU callbacks and flush after 5039 + delay, memory pressure or callback list growing too 5040 + big. 5041 + 5037 5042 rcuscale.gp_async= [KNL] 5038 5043 Measure performance of asynchronous 5039 5044 grace-period primitives such as call_rcu().
+13
kernel/rcu/Kconfig
··· 314 314 To save power, batch RCU callbacks and flush after delay, memory 315 315 pressure, or callback list growing too big. 316 316 317 + Requires rcu_nocbs=all to be set. 318 + 319 + Use rcutree.enable_rcu_lazy=0 to turn it off at boot time. 320 + 321 + config RCU_LAZY_DEFAULT_OFF 322 + bool "Turn RCU lazy invocation off by default" 323 + depends on RCU_LAZY 324 + default n 325 + help 326 + Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default 327 + off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch 328 + it back on. 329 + 317 330 config RCU_DOUBLE_CHECK_CB_TIME 318 331 bool "RCU callback-batch backup time check" 319 332 depends on RCU_EXPERT
+6 -1
kernel/rcu/tree.c
··· 2753 2753 } 2754 2754 2755 2755 #ifdef CONFIG_RCU_LAZY 2756 + static bool enable_rcu_lazy __read_mostly = !IS_ENABLED(CONFIG_RCU_LAZY_DEFAULT_OFF); 2757 + module_param(enable_rcu_lazy, bool, 0444); 2758 + 2756 2759 /** 2757 2760 * call_rcu_hurry() - Queue RCU callback for invocation after grace period, and 2758 2761 * flush all lazy callbacks (including the new one) to the main ->cblist while ··· 2781 2778 __call_rcu_common(head, func, false); 2782 2779 } 2783 2780 EXPORT_SYMBOL_GPL(call_rcu_hurry); 2781 + #else 2782 + #define enable_rcu_lazy false 2784 2783 #endif 2785 2784 2786 2785 /** ··· 2831 2826 */ 2832 2827 void call_rcu(struct rcu_head *head, rcu_callback_t func) 2833 2828 { 2834 - __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); 2829 + __call_rcu_common(head, func, enable_rcu_lazy); 2835 2830 } 2836 2831 EXPORT_SYMBOL_GPL(call_rcu); 2837 2832