Message ID | tencent_7BC3270CBC8463FB34858B4F9101E9329605@qq.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [linux-next,RFC] powerpc: protect cpu offlining by RCU offline lock | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_selftests | success | Successfully ran 10 jobs. |
snowpatch_ozlabs/github-powerpc_ppctests | success | Successfully ran 10 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 6 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 23 jobs. |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 0f8cd8b06432..ddf66a253c70 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -64,11 +64,14 @@ static void pseries_cpu_offline_self(void) local_irq_disable(); idle_task_exit(); + + /* Because the cpu is now offline, let rcu know that */ + rcu_state_ofl_lock(); if (xive_enabled()) xive_teardown_cpu(); else xics_teardown_cpu(); - + rcu_state_ofl_unlock(); unregister_slb_shadow(hwcpu); rtas_stop_self(); diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 63d2e6a60ad7..d857955a02ba 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -1034,5 +1034,6 @@ rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f) /* kernel/ksysfs.c definitions */ extern int rcu_expedited; extern int rcu_normal; - +void rcu_state_ofl_lock(void); +void rcu_state_ofl_unlock(void); #endif /* __LINUX_RCUPDATE_H */ diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 6bb8e72bc815..3282725f1054 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4796,6 +4796,16 @@ void __init rcu_init(void) (void)start_poll_synchronize_rcu_expedited(); } +void rcu_state_ofl_lock(void) +{ + arch_spin_lock(&rcu_state.ofl_lock); +} + +void rcu_state_ofl_unlock(void) +{ + arch_spin_unlock(&rcu_state.ofl_lock); +} + #include "tree_stall.h" #include "tree_exp.h" #include "tree_nocb.h"