Skip to content

Commit ba65ab3

Browse files
committed
locktorture: Dump CPUs running writer tasks when RCU stalls
This commit force stack dumps of the CPUs running writer tasks when an RCU CPU stall warning occurs. This is helpful in the common case where RCU isn't being stalled by all of those tasks, and thus won't dump their stacks. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 2b097a6 commit ba65ab3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/locking/locktorture.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ void __weak spinlock_dump(spinlock_t *sp, bool full)
284284

285285
static int torture_spin_lock_dump(struct notifier_block *nb, unsigned long v, void *ptr)
286286
{
287+
int cpu;
287288
struct task_struct *t = READ_ONCE(lock_is_write_held);
288289

289290
pr_alert("%s invoked: v=%lu, duration=%lu.\n", __func__, v, (unsigned long)ptr);
@@ -295,6 +296,8 @@ static int torture_spin_lock_dump(struct notifier_block *nb, unsigned long v, vo
295296
sched_show_task(t);
296297
}
297298
spinlock_dump(&torture_spinlock, true);
299+
for_each_cpu(cpu, bind_writers)
300+
dump_cpu_task(cpu);
298301
return NOTIFY_OK;
299302
}
300303

0 commit comments

Comments
 (0)