linux/kernel/rcu
Frederic Weisbecker f2e555fc04 rcu/exp: Protect against early QS report
When a grace period is started, the ->expmask of each node is set up
from sync_exp_reset_tree(). Then later on each leaf node also initialize
its ->exp_tasks pointer.

This means that the initialization of the quiescent state of a node and
the initialization of its blocking tasks happen with an unlocked node
gap in-between.

It happens to be fine because nothing is expected to report an exp
quiescent state within this gap, since no IPI have been issued yet and
every rdp's ->cpu_no_qs.b.exp should be false.

However if it were to happen by accident, the quiescent state could be
reported and propagated while ignoring tasks that blocked _before_ the
start of the grace period.

Prevent such trouble to happen in the future and initialize both the
quiescent states mask to report and the blocked tasks head from the same
node locked block.

If a task blocks within an RCU read side critical section before
sync_exp_reset_tree() is called and is then unblocked between
sync_exp_reset_tree() and __sync_rcu_exp_select_node_cpus(), the QS
won't be reported because no RCU exp IPI had been issued to request it
through the setting of srdp->cpu_no_qs.b.exp.

Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
2025-06-25 08:36:18 +05:30
..
Kconfig srcu: Make FORCE_NEED_SRCU_NMI_SAFE depend on RCU_EXPERT 2025-03-28 21:19:17 -07:00
Kconfig.debug rcutorture: Move RCU_TORTURE_TEST_{CHK_RDR_STATE,LOG_CPU} to bool 2025-02-05 07:14:40 -08:00
Makefile
rcu_segcblist.c rcu/nocb: Simplify (de-)offloading state machine 2024-09-09 00:03:55 +05:30
rcu_segcblist.h rcu: Remove unused declaration rcu_segcblist_offload() 2024-10-22 15:36:56 +02:00
rcu.h Merge branches 'rcu/misc-for-6.16', 'rcu/seq-counters-for-6.16' and 'rcu/torture-for-6.16' into rcu/for-next 2025-05-16 11:18:16 -04:00
rcuscale.c rcuscale: using kcalloc() to relpace kmalloc() 2025-05-16 09:00:54 -04:00
rcutorture.c Another set of timer API cleanups: 2025-05-27 08:31:21 -07:00
refscale.c refscale: Add srcu_read_lock_fast() support using "srcu-fast" 2025-02-05 07:12:05 -08:00
srcutiny.c Merge branches 'docs.2025.02.04a', 'lazypreempt.2025.03.04a', 'misc.2025.03.04a', 'srcu.2025.02.05a' and 'torture.2025.02.05a' 2025-03-04 18:47:32 -08:00
srcutree.c srcu: Use rcu_seq_done_exact() for polling API 2025-04-08 14:55:55 -04:00
sync.c rcu: Eliminate lockless accesses to rcu_sync->gp_count 2024-07-04 13:48:57 -07:00
tasks.h treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
tiny.c RCU pull request for v6.15 2025-03-24 19:41:37 -07:00
tree_exp.h rcu/exp: Protect against early QS report 2025-06-25 08:36:18 +05:30
tree_nocb.h treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
tree_plugin.h rcu/nocb: Add Safe checks for access offloaded rdp 2025-05-16 09:00:54 -04:00
tree_stall.h kernel/rcu/tree_stall: add /sys/kernel/rcu_stall_count 2025-06-05 22:02:25 -07:00
tree.c rcu: Return early if callback is not specified 2025-06-20 15:31:48 -04:00
tree.h Merge branches 'rcu/misc-for-6.16', 'rcu/seq-counters-for-6.16' and 'rcu/torture-for-6.16' into rcu/for-next 2025-05-16 11:18:16 -04:00
update.c torture: Add dowarn argument to torture_sched_setaffinity() 2024-12-14 16:38:23 +01:00