diff options
-rw-r--r-- | include/linux/rcupdate.h | 1 | ||||
-rw-r--r-- | init/Kconfig | 13 | ||||
-rw-r--r-- | kernel/rcu/update.c | 11 |
3 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 57a4d1f73a00..b9f039b11d31 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -278,6 +278,7 @@ static inline int rcu_preempt_depth(void) | |||
278 | 278 | ||
279 | /* Internal to kernel */ | 279 | /* Internal to kernel */ |
280 | void rcu_init(void); | 280 | void rcu_init(void); |
281 | void rcu_end_inkernel_boot(void); | ||
281 | void rcu_sched_qs(void); | 282 | void rcu_sched_qs(void); |
282 | void rcu_bh_qs(void); | 283 | void rcu_bh_qs(void); |
283 | void rcu_check_callbacks(int user); | 284 | void rcu_check_callbacks(int user); |
diff --git a/init/Kconfig b/init/Kconfig index f5dbc6d4261b..9a0592516f48 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -791,6 +791,19 @@ config RCU_NOCB_CPU_ALL | |||
791 | 791 | ||
792 | endchoice | 792 | endchoice |
793 | 793 | ||
794 | config RCU_EXPEDITE_BOOT | ||
795 | bool | ||
796 | default n | ||
797 | help | ||
798 | This option enables expedited grace periods at boot time, | ||
799 | as if rcu_expedite_gp() had been invoked early in boot. | ||
800 | The corresponding rcu_unexpedite_gp() is invoked from | ||
801 | rcu_end_inkernel_boot(), which is intended to be invoked | ||
802 | at the end of the kernel-only boot sequence, just before | ||
803 | init is exec'ed. | ||
804 | |||
805 | Accept the default if unsure. | ||
806 | |||
794 | endmenu # "RCU Subsystem" | 807 | endmenu # "RCU Subsystem" |
795 | 808 | ||
796 | config BUILD_BIN2C | 809 | config BUILD_BIN2C |
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 5f850823c187..7b12466f90bc 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c | |||
@@ -64,7 +64,8 @@ module_param(rcu_expedited, int, 0); | |||
64 | 64 | ||
65 | #ifndef CONFIG_TINY_RCU | 65 | #ifndef CONFIG_TINY_RCU |
66 | 66 | ||
67 | static atomic_t rcu_expedited_nesting; | 67 | static atomic_t rcu_expedited_nesting = |
68 | ATOMIC_INIT(IS_ENABLED(CONFIG_RCU_EXPEDITE_BOOT) ? 1 : 0); | ||
68 | 69 | ||
69 | /* | 70 | /* |
70 | * Should normal grace-period primitives be expedited? Intended for | 71 | * Should normal grace-period primitives be expedited? Intended for |
@@ -109,6 +110,14 @@ EXPORT_SYMBOL_GPL(rcu_unexpedite_gp); | |||
109 | 110 | ||
110 | #endif /* #ifndef CONFIG_TINY_RCU */ | 111 | #endif /* #ifndef CONFIG_TINY_RCU */ |
111 | 112 | ||
113 | /* | ||
114 | * Inform RCU of the end of the in-kernel boot sequence. | ||
115 | */ | ||
116 | void rcu_end_inkernel_boot(void) | ||
117 | { | ||
118 | if (IS_ENABLED(CONFIG_RCU_EXPEDITE_BOOT)) | ||
119 | rcu_unexpedite_gp(); | ||
120 | } | ||
112 | 121 | ||
113 | #ifdef CONFIG_PREEMPT_RCU | 122 | #ifdef CONFIG_PREEMPT_RCU |
114 | 123 | ||