diff --git a/kernel/hung_task.c b/kernel/hung_task.c index f108a95..2fddd98 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -164,6 +164,23 @@ static bool rcu_lock_break(struct task_struct *g, struct task_struct *t) return can_cont; } +static void print_all_running_threads(void) +{ +#ifdef CONFIG_SMP + struct task_struct *g; + struct task_struct *t; + + rcu_read_lock(); + for_each_process_thread(g, t) { + if (!t->on_cpu || t == current) + continue; + pr_err("INFO: Currently running\n"); + sched_show_task(t); + } + rcu_read_unlock(); +#endif +} + /* * Check whether a TASK_UNINTERRUPTIBLE does not get woken up for * a really long time (120 seconds). If that happens, print out @@ -201,7 +218,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout) if (hung_task_show_lock) debug_show_all_locks(); if (hung_task_call_panic) { - trigger_all_cpu_backtrace(); + print_all_running_threads(); panic("hung_task: blocked tasks"); } } diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index e221be7..5ea9531 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -611,12 +611,6 @@ static void lockdep_print_held_locks(struct task_struct *p) else printk("%d lock%s held by %s/%d:\n", depth, depth > 1 ? "s" : "", p->comm, task_pid_nr(p)); - /* - * It's not reliable to print a task's held locks if it's not sleeping - * and it's not the current task. - */ - if (p->state == TASK_RUNNING && p != current) - return; for (i = 0; i < depth; i++) { printk(" #%d: ", i); print_lock(p->held_locks + i);