Skip to content

Commit 7e0669c

Browse files
committed
rcu-tasks: Add IPI failure count to statistics
This commit adds a failure-return count for smp_call_function_single(), and adds this to the console messages for rcutorture writer stalls and at the end of rcutorture testing. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 039f3cc commit 7e0669c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kernel/rcu/tasks.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef void (*postgp_func_t)(struct rcu_tasks *rtp);
3232
* @gp_start: Most recent grace-period start in jiffies.
3333
* @n_gps: Number of grace periods completed since boot.
3434
* @n_ipis: Number of IPIs sent to encourage grace periods to end.
35+
* @n_ipis_fails: Number of IPI-send failures.
3536
* @pregp_func: This flavor's pre-grace-period function (optional).
3637
* @pertask_func: This flavor's per-task scan function (optional).
3738
* @postscan_func: This flavor's post-task scan function (optional).
@@ -51,6 +52,7 @@ struct rcu_tasks {
5152
unsigned long gp_start;
5253
unsigned long n_gps;
5354
unsigned long n_ipis;
55+
unsigned long n_ipis_fails;
5456
struct task_struct *kthread_ptr;
5557
rcu_tasks_gp_func_t gp_func;
5658
pregp_func_t pregp_func;
@@ -290,12 +292,12 @@ static void __init rcu_tasks_bootup_oddness(void)
290292
/* Dump out rcutorture-relevant state common to all RCU-tasks flavors. */
291293
static void show_rcu_tasks_generic_gp_kthread(struct rcu_tasks *rtp, char *s)
292294
{
293-
pr_info("%s: %s(%d) since %lu g:%lu i:%lu %c%c %s\n",
295+
pr_info("%s: %s(%d) since %lu g:%lu i:%lu/%lu %c%c %s\n",
294296
rtp->kname,
295-
tasks_gp_state_getname(rtp),
296-
data_race(rtp->gp_state),
297+
tasks_gp_state_getname(rtp), data_race(rtp->gp_state),
297298
jiffies - data_race(rtp->gp_jiffies),
298-
data_race(rtp->n_gps), data_race(rtp->n_ipis),
299+
data_race(rtp->n_gps),
300+
data_race(rtp->n_ipis_fails), data_race(rtp->n_ipis),
299301
".k"[!!data_race(rtp->kthread_ptr)],
300302
".C"[!!data_race(rtp->cbs_head)],
301303
s);
@@ -909,6 +911,7 @@ static void trc_wait_for_one_reader(struct task_struct *t,
909911
trc_read_check_handler, t, 0)) {
910912
// Just in case there is some other reason for
911913
// failure than the target CPU being offline.
914+
rcu_tasks_trace.n_ipis_fails++;
912915
per_cpu(trc_ipi_to_cpu, cpu) = false;
913916
t->trc_ipi_to_cpu = cpu;
914917
if (atomic_dec_and_test(&trc_n_readers_need_end)) {

0 commit comments

Comments
 (0)