OSDN Git Service

rcu-tasks: *_ONCE() for rcu_tasks_cbs_head
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 6 Jan 2020 19:59:58 +0000 (11:59 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Feb 2020 00:00:45 +0000 (16:00 -0800)
commitfcb7381265e6cceb1d54283878d145db52b9d9d7
tree15e2312520978a9d75c899589dee35dd57026896
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9
rcu-tasks: *_ONCE() for rcu_tasks_cbs_head

The RCU tasks list of callbacks, rcu_tasks_cbs_head, is sampled locklessly
by rcu_tasks_kthread() when waiting for work to do.  This commit therefore
applies READ_ONCE() to that lockless sampling and WRITE_ONCE() to the
single potential store outside of rcu_tasks_kthread.

This data race was reported by KCSAN.  Not appropriate for backporting
due to failure being unlikely.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/update.c