Skip to content

Commit ec1fe39

Browse files
mirabpaulmck
authored andcommitted
rcu: Fix RCU CPU stall detection in tiny implementation
The tiny RCU CPU stall detection depends on *rcp->curtail not being NULL. It is however a tail pointer and thus NULL by definition. Instead we should check rcp->rcucblist for the presence of pending callbacks which need to be processed. With this fix INFO about the stall is printed and jiffies_stall (jiffies at next stall) correctly updated. Note that the check for pending callback is necessary to avoid spurious warnings if there are no pendings callbacks. Signed-off-by: Miroslav Benes <mbenes@suse.cz> [ paulmck: Fused identical "if" statements, ported to -rcu. ] Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent fb81a44 commit ec1fe39

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎kernel/rcu/tiny_plugin.h‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,16 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
145145
rcp->ticks_this_gp++;
146146
j = jiffies;
147147
js = ACCESS_ONCE(rcp->jiffies_stall);
148-
if (*rcp->curtail && ULONG_CMP_GE(j, js)) {
148+
if (rcp->rcucblist && ULONG_CMP_GE(j, js)) {
149149
pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
150150
rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting,
151151
jiffies - rcp->gp_start, rcp->qlen);
152152
dump_stack();
153-
}
154-
if (*rcp->curtail && ULONG_CMP_GE(j, js))
155153
ACCESS_ONCE(rcp->jiffies_stall) = jiffies +
156154
3 * rcu_jiffies_till_stall_check() + 3;
157-
else if (ULONG_CMP_GE(j, js))
155+
} else if (ULONG_CMP_GE(j, js)) {
158156
ACCESS_ONCE(rcp->jiffies_stall) = jiffies + rcu_jiffies_till_stall_check();
157+
}
159158
}
160159

161160
static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)

0 commit comments

Comments
 (0)