summaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorPaul E. McKenney2015-06-10 22:34:41 +0200
committerPaul E. McKenney2015-07-23 00:27:30 +0200
commit779de6ce54f627f955d4a3d0c5b3dcfaab74fea8 (patch)
tree970e26e9d25d2beab184fb7c87e8ff1c5d348023 /kernel/cpu.c
parentrcu: Create a synchronize_rcu_mult() (diff)
downloadkernel-qcow2-linux-779de6ce54f627f955d4a3d0c5b3dcfaab74fea8.tar.gz
kernel-qcow2-linux-779de6ce54f627f955d4a3d0c5b3dcfaab74fea8.tar.xz
kernel-qcow2-linux-779de6ce54f627f955d4a3d0c5b3dcfaab74fea8.zip
cpu: Wait for RCU grace periods concurrently
In kernels built with CONFIG_PREEMPT, _cpu_down() waits for RCU and RCU-sched grace periods back-to-back, incurring quite a bit more latency than required. This commit therefore uses the new synchronize_rcu_mult() to allow waiting for both grace periods concurrently. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9c9c9fab16cc..d63b062b6267 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -380,14 +380,14 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
* will observe it.
*
* For CONFIG_PREEMPT we have preemptible RCU and its sync_rcu() might
- * not imply sync_sched(), so explicitly call both.
+ * not imply sync_sched(), so wait for both.
*
* Do sync before park smpboot threads to take care the rcu boost case.
*/
-#ifdef CONFIG_PREEMPT
- synchronize_sched();
-#endif
- synchronize_rcu();
+ if (IS_ENABLED(CONFIG_PREEMPT))
+ synchronize_rcu_mult(call_rcu, call_rcu_sched);
+ else
+ synchronize_rcu();
smpboot_park_threads(cpu);