rcu: Fix the (t=0 jiffies) false positive
authorZhaolong Zhang <zhangzl2013@126.com>
Thu, 5 Mar 2020 22:56:11 +0000 (14:56 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 27 Apr 2020 18:01:16 +0000 (11:01 -0700)
commitfcbcc0e700500fcecf24b9b705825135de30415e
tree74634d1d883a87d969ca2a737c66a2b3b85dc8bc
parent1fca4d12f46371a34bf90af87f49548dd026c3ca
rcu: Fix the (t=0 jiffies) false positive

It is possible that an over-long grace period will end while the RCU
CPU stall warning message is printing.  In this case, the estimate of
the offending grace period's duration can be erroneous due to refetching
of rcu_state.gp_start, which will now be the time of the newly started
grace period.  Computation of this duration clearly needs to use the
start time for the old over-long grace period, not the fresh new one.
This commit avoids such errors by causing both print_other_cpu_stall() and
print_cpu_stall() to reuse the value previously fetched by their caller.

Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_stall.h