linux-stable/kernel/rcu
Paul E. McKenney 896f4d6046 rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp
[ Upstream commit 9146eb2549 ]

The per-CPU rcu_data structure's ->cpu_no_qs.b.exp field is updated
only on the instance corresponding to the current CPU, but can be read
more widely.  Unmarked accesses are OK from the corresponding CPU, but
only if interrupts are disabled, given that interrupt handlers can and
do modify this field.

Unfortunately, although the load from rcu_preempt_deferred_qs() is always
carried out from the corresponding CPU, interrupts are not necessarily
disabled.  This commit therefore upgrades this load to READ_ONCE.

Similarly, the diagnostic access from synchronize_rcu_expedited_wait()
might run with interrupts disabled and from some other CPU.  This commit
therefore marks this load with data_race().

Finally, the C-language access in rcu_preempt_ctxt_queue() is OK as
is because interrupts are disabled and this load is always from the
corresponding CPU.  This commit adds a comment giving the rationale for
this access being safe.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:50:33 +02:00
..
Kconfig Merge branch 'ctxt.2022.07.05a' into HEAD 2022-07-21 17:46:18 -07:00
Kconfig.debug Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
Makefile
rcu.h rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs 2023-07-19 16:21:01 +02:00
rcu_segcblist.c rcu: Clarify fill-the-gap comment in rcu_segcblist_advance() 2022-04-11 17:28:48 -07:00
rcu_segcblist.h rcu: Mark writes to the rcu_segcblist structure's ->flags field 2022-02-14 10:36:58 -08:00
rcuscale.c rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale 2023-07-19 16:21:02 +02:00
rcutorture.c Merge branches 'doc.2022.08.31b', 'fixes.2022.08.31b', 'kvfree.2022.08.31b', 'nocb.2022.09.01a', 'poll.2022.08.31b', 'poll-srcu.2022.08.31b' and 'tasks.2022.08.31b' into HEAD 2022-09-01 10:55:57 -07:00
refscale.c refscale: Move shutdown from wait_event() to wait_event_idle() 2023-05-24 17:32:33 +01:00
srcutiny.c srcu: Make Tiny SRCU use full-sized grace-period counters 2022-08-31 05:10:15 -07:00
srcutree.c srcu: Delegate work to the boot cpu if using SRCU_SIZE_SMALL 2023-03-10 09:33:48 +01:00
sync.c rcu_sync: Fix comment to properly reflect rcu_sync_exit() behavior 2022-04-20 16:51:11 -07:00
tasks.h rcu-tasks: Avoid pr_info() with spin lock in cblist_init_generic() 2023-07-27 08:50:33 +02:00
tiny.c Merge branches 'doc.2022.08.31b', 'fixes.2022.08.31b', 'kvfree.2022.08.31b', 'nocb.2022.09.01a', 'poll.2022.08.31b', 'poll-srcu.2022.08.31b' and 'tasks.2022.08.31b' into HEAD 2022-09-01 10:55:57 -07:00
tree.c rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs 2023-07-19 16:21:01 +02:00
tree.h Merge branch 'ctxt.2022.07.05a' into HEAD 2022-07-21 17:46:18 -07:00
tree_exp.h rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp 2023-07-27 08:50:33 +02:00
tree_nocb.h rcu/nocb: Add CPU number to CPU-{,de}offload failure messages 2022-08-31 05:07:19 -07:00
tree_plugin.h rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp 2023-07-27 08:50:33 +02:00
tree_stall.h sched/debug: Try trigger_single_cpu_backtrace(cpu) in dump_cpu_task() 2022-08-31 05:03:14 -07:00
update.c Merge branch 'ctxt.2022.07.05a' into HEAD 2022-07-21 17:46:18 -07:00