android_kernel_sony_sdm845/kernel/rcu
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Paul E. McKenney 24bbf2d6a7 srcu: Provide ordering for CPU not involved in grace period
Tree RCU guarantees that every online CPU has a memory barrier between
any given grace period and any of that CPU's RCU read-side sections that
must be ordered against that grace period.  Since RCU doesn't always
know where read-side critical sections are, the actual implementation
guarantees order against prior and subsequent non-idle non-offline code,
whether in an RCU read-side critical section or not.  As a result, there
does not need to be a memory barrier at the end of synchronize_rcu()
and friends because the ordering internal to the grace period has
ordered every CPU's post-grace-period execution against each CPU's
pre-grace-period execution, again for all non-idle online CPUs.

In contrast, SRCU can have non-idle online CPUs that are completely
uninvolved in a given SRCU grace period, for example, a CPU that
never runs any SRCU read-side critical sections and took no part in
the grace-period processing.  It is in theory possible for a given
synchronize_srcu()'s wakeup to be delivered to a CPU that was completely
uninvolved in the prior SRCU grace period, which could mean that the
code following that synchronize_srcu() would end up being unordered with
respect to both the grace period and any pre-existing SRCU read-side
critical sections.

This commit therefore adds an smp_mb() to the end of __synchronize_srcu(),
which prevents this scenario from occurring.

Reported-by: Lance Roy <ldr709@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Lance Roy <ldr709@gmail.com>
Cc: <stable@vger.kernel.org> # 4.12.x
Signed-off-by: Twisted <36546624+TwistedPrime@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
2026-05-15 17:49:32 +07:00
..
Kconfig BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
Kconfig.debug BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
Makefile BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
rcu.h rcu: Create RCU-specific workqueues with rescuers 2026-05-15 17:49:31 +07:00
rcu_segcblist.c rcu: Remove unused RCU list functions 2026-05-15 17:49:32 +07:00
rcu_segcblist.h rcu: Remove unused RCU list functions 2026-05-15 17:49:32 +07:00
rcuperf.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
rcutorture.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
srcutiny.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
srcutree.c srcu: Provide ordering for CPU not involved in grace period 2026-05-15 17:49:32 +07:00
sync.c locking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write() 2016-08-18 15:36:59 +02:00
tiny.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00
tree.c rcu: Move callback-list warning to irq-disable region 2026-05-15 17:49:32 +07:00
tree.h rcu: Localize rcu_state ->orphan_pend and ->orphan_done 2026-05-15 17:49:32 +07:00
tree_exp.h rcu: Make expedited GPs correctly handle hardware CPU insertion 2026-05-15 17:49:31 +07:00
tree_plugin.h rcu: Make NOCB CPUs migrate CBs directly from outgoing CPU 2026-05-15 17:49:31 +07:00
update.c BACKPORT: rcu: Ports some of RCU's taken from k4.14 2026-05-15 17:49:30 +07:00