hung_task: ignore hung_task_warnings while hung_task_panic is set

If hung_task_panic is set, ignore the value of hung_task_warnings
and print the task information of hungtask.

In certain scenarios, hung_task_panic might not be initially set up,
leading to multiple hung tasks and depletion of hung_task_warnings
count. If hung_task_panic is configured afterward, it may not print
any effective hung task information.

Signed-off-by: Yongliang Gao <leonylgao@tencent.com>
Reviewed-by: Huang Cun <cunhuang@tencent.com>
Reviewed-by: Jianping Liu <frankjpliu@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
This commit is contained in:
Yongliang Gao 2024-06-07 11:00:29 +08:00 committed by Jianping Liu
parent cdd21b141d
commit fb48a99d11
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
* Ok, the task did not get scheduled for more than 2 minutes,
* complain:
*/
if (sysctl_hung_task_warnings) {
if (sysctl_hung_task_warnings || hung_task_call_panic) {
if (sysctl_hung_task_warnings > 0)
sysctl_hung_task_warnings--;
pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",