Skip to content

Commit

Permalink
rcu: Start timing stall repetitions after warning complete
Browse files Browse the repository at this point in the history
Systems with low-bandwidth consoles can have very large printk()
latencies, and on such systems it makes no sense to have the next RCU CPU
stall warning message start output before the prior message completed.
This commit therefore sets the time of the next stall only after the
prints have completed.  While printing, the time of the next stall
message is set to ULONG_MAX/2 jiffies into the future.

Reviewed-by: Sergey Senozhatsky <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmckrcu committed Aug 6, 2021
1 parent a80be42 commit b169246
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kernel/rcu/tree_stall.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ static void print_cpu_stall(unsigned long gps)

static void check_cpu_stall(struct rcu_data *rdp)
{
bool didstall = false;
unsigned long gs1;
unsigned long gs2;
unsigned long gps;
Expand Down Expand Up @@ -692,7 +693,7 @@ static void check_cpu_stall(struct rcu_data *rdp)
ULONG_CMP_GE(gps, js))
return; /* No stall or GP completed since entering function. */
rnp = rdp->mynode;
jn = jiffies + 3 * rcu_jiffies_till_stall_check() + 3;
jn = jiffies + ULONG_MAX / 2;
if (rcu_gp_in_progress() &&
(READ_ONCE(rnp->qsmask) & rdp->grpmask) &&
cmpxchg(&rcu_state.jiffies_stall, js, jn) == js) {
Expand All @@ -709,6 +710,7 @@ static void check_cpu_stall(struct rcu_data *rdp)
print_cpu_stall(gps);
if (READ_ONCE(rcu_cpu_stall_ftrace_dump))
rcu_ftrace_dump(DUMP_ALL);
didstall = true;

} else if (rcu_gp_in_progress() &&
ULONG_CMP_GE(j, js + RCU_STALL_RAT_DELAY) &&
Expand All @@ -726,6 +728,11 @@ static void check_cpu_stall(struct rcu_data *rdp)
print_other_cpu_stall(gs2, gps);
if (READ_ONCE(rcu_cpu_stall_ftrace_dump))
rcu_ftrace_dump(DUMP_ALL);
didstall = true;
}
if (didstall && READ_ONCE(rcu_state.jiffies_stall) == jn) {
jn = jiffies + 3 * rcu_jiffies_till_stall_check() + 3;
WRITE_ONCE(rcu_state.jiffies_stall, jn);
}
}

Expand Down

0 comments on commit b169246

Please sign in to comment.