summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2019-09-14 00:09:56 +0300
committerPaul E. McKenney <paulmck@kernel.org>2019-10-28 17:02:21 +0300
commited93dfc6bc0084485ccad1ff6bd2ea81ab2c03cd (patch)
tree795726f4fab078ee48218e767f4bead620e7ab8e /net/sunrpc/xprtsock.c
parent516e5ae0c94016294d3ef175454215b235d03945 (diff)
downloadlinux-ed93dfc6bc0084485ccad1ff6bd2ea81ab2c03cd.tar.xz
rcu: Confine ->core_needs_qs accesses to the corresponding CPU
Commit 671a63517cf9 ("rcu: Avoid unnecessary softirq when system is idle") fixed a bug that could result in an indefinite number of unnecessary invocations of the RCU_SOFTIRQ handler at the trailing edge of a scheduler-clock interrupt. However, the fix introduced off-CPU stores to ->core_needs_qs. These writes did not conflict with the on-CPU stores because the CPU's leaf rcu_node structure's ->lock was held across all such stores. However, the loads from ->core_needs_qs were not promoted to READ_ONCE() and, worse yet, the code loading from ->core_needs_qs was written assuming that it was only ever updated by the corresponding CPU. So operation has been robust, but only by luck. This situation is therefore an accident waiting to happen. This commit therefore takes a different approach. Instead of clearing ->core_needs_qs from the grace-period kthread's force-quiescent-state processing, it modifies the rcu_pending() function to suppress the rcu_sched_clock_irq() function's call to invoke_rcu_core() if there is no grace period in progress. This avoids the infinite needless RCU_SOFTIRQ handlers while still keeping all accesses to ->core_needs_qs local to the corresponding CPU. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
0 files changed, 0 insertions, 0 deletions