rcu: Mark rcu_cpu_kthread() accesses to ->rcu_cpu_has_work
Subsystems (2)
Sasha Levin
maintainerPATCH 1/1 rcu: Mark rcu_cpu_kthread() accesses to ->rcu_cpu_has_work
From: "Paul E. McKenney" <[email protected]>
[ Upstream commit a24c1aab652ebacf9ea62470a166514174c96fe1 ]
The rcu_data structure's ->rcu_cpu_has_work field can be modified by any CPU attempting to wake up the rcuc kthread. Therefore, this commit marks accesses to this field from the rcu_cpu_kthread() function.
This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely.
--- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree.c +2 -2
@@ -2810,12 +2810,12 @@ static void rcu_cpu_kthread(unsigned int cpu) *statusp =RCU_KTHREAD_RUNNING ;local_irq_disable (); work = *workp; - *workp =0 ; +WRITE_ONCE (*workp,0 );local_irq_enable ();if (work)rcu_core ();local_bh_enable (); -if (*workp ==0 ) { +if (!READ_ONCE (*workp)) {trace_rcu_utilization (TPS ("End CPU kthread@rcu_wait" )); *statusp =RCU_KTHREAD_WAITING ;return ;
Signature · 1 line
2.39.2
Quoted 10 lines · Sasha Levin
From: "Paul E. McKenney" <[email protected]>
[ Upstream commit
a24c1aab652ebacf9ea62470a166514174c96fe1]The
rcu_datastructure's ->rcu_cpu_has_work field can be modified by any CPU attempting to wake up the rcuc kthread. Therefore, this commit marks accesses to this field from thercu_cpu_kthread()function.This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely.
Please drop.
Best regards,
Pavel
Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.