]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - kernel/hung_task.c
x86/speculation/mds: Add sysfs reporting for MDS
[mirror_ubuntu-bionic-kernel.git] / kernel / hung_task.c
index 751593ed7c0b0b9cc9bf74735fb9bd5d7e100be2..32b479468e4d50d69530ad766ba7e3897afa5cc3 100644 (file)
@@ -44,6 +44,7 @@ int __read_mostly sysctl_hung_task_warnings = 10;
 
 static int __read_mostly did_panic;
 static bool hung_task_show_lock;
+static bool hung_task_call_panic;
 
 static struct task_struct *watchdog_task;
 
@@ -127,10 +128,8 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
        touch_nmi_watchdog();
 
        if (sysctl_hung_task_panic) {
-               if (hung_task_show_lock)
-                       debug_show_all_locks();
-               trigger_all_cpu_backtrace();
-               panic("hung_task: blocked tasks");
+               hung_task_show_lock = true;
+               hung_task_call_panic = true;
        }
 }
 
@@ -193,6 +192,10 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
        rcu_read_unlock();
        if (hung_task_show_lock)
                debug_show_all_locks();
+       if (hung_task_call_panic) {
+               trigger_all_cpu_backtrace();
+               panic("hung_task: blocked tasks");
+       }
 }
 
 static long hung_timeout_jiffies(unsigned long last_checked,