OSDN Git Service

rcu: IPI all CPUs at GP end for strict GPs
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 7 Aug 2020 02:42:47 +0000 (19:42 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 25 Aug 2020 01:40:26 +0000 (18:40 -0700)
commit4e025f52a1e0e8ff4e303fa0a80e2061ccfa27d6
tree4b9f198966d56c80579b1f52a8bb1d65cb107578
parent933ada2c3310aa88807e65c8d498b74a2159a9a2
rcu: IPI all CPUs at GP end for strict GPs

Currently, each CPU discovers the end of a given grace period on its
own time, which is again good for efficiency but bad for fast grace
periods, given that it is things like kfree() within the RCU callbacks
that will cause trouble for pointers leaked from RCU read-side critical
sections.  This commit therefore uses on_each_cpu() to IPI each CPU
after grace-period cleanup in order to inform each CPU of the end of
the old grace period in a timely manner, but only in kernels build with
CONFIG_RCU_STRICT_GRACE_PERIOD=y.

Reported-by Jann Horn <jannh@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c