Commit 168e06f7 authored by Liu, Chuansheng's avatar Liu, Chuansheng Committed by Linus Torvalds

kernel/hung_task.c: force console verbose before panic

Based on commit 401c636a ("kernel/hung_task.c: show all hung tasks
before panic"), we could get the call stack of hung task.

However, if the console loglevel is not high, we still can not see the
useful panic information in practice, and in most cases users don't set
console loglevel to high level.

This patch is to force console verbose before system panic, so that the
real useful information can be seen in the console, instead of being
like the following, which doesn't have hung task information.

  INFO: task init:1 blocked for more than 120 seconds.
        Tainted: G     U  W         4.19.0-quilt-2e5dc0ac-g51b6c21d76cc #1
  "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
  Kernel panic - not syncing: hung_task: blocked tasks
  CPU: 2 PID: 479 Comm: khungtaskd Tainted: G     U  W         4.19.0-quilt-2e5dc0ac-g51b6c21d76cc #1
  Call Trace:
  reboot: panic mode set: p,w
  Kernel Offset: 0x34000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)

Link: default avatarChuansheng Liu <>
Reviewed-by: default avatarPetr Mladek <>
Reviewed-by: default avatarSergey Senozhatsky <>
Cc: Tetsuo Handa <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 527edbc1
......@@ -112,8 +112,11 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
if (!sysctl_hung_task_warnings && !sysctl_hung_task_panic)
if (sysctl_hung_task_panic) {
hung_task_show_lock = true;
hung_task_call_panic = true;
* Ok, the task did not get scheduled for more than 2 minutes,
......@@ -135,11 +138,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
if (sysctl_hung_task_panic) {
hung_task_show_lock = true;
hung_task_call_panic = true;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment