mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yongliang Gao <leonylgao@gmail.com>
To: kent.overstreet@linux.dev, j.granados@samsung.com,
	jsiddle@redhat.com, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
	Yongliang Gao <leonylgao@tencent.com>,
	Huang Cun <cunhuang@tencent.com>
Subject: [PATCH] hung_task: ignore hung_task_warnings when hung_task_panic is enabled
Date: Thu, 13 Jun 2024 11:31:59 +0800	[thread overview]
Message-ID: <20240613033159.3446265-1-leonylgao@gmail.com> (raw)

From: Yongliang Gao <leonylgao@tencent.com>

If hung_task_panic is enabled, don't consider the value of
hung_task_warnings and display the information of the hung
tasks.

In some cases, hung_task_panic might not be initially set up,
after several hung tasks occur, the hung_task_warnings count
reaches zero. If hung_task_panic is set up later, it may not
display any helpful hung task info in dmesg, only showing
messages like:

Kernel panic - not syncing: hung_task: blocked tasks
CPU: 3 PID: 58 Comm: khungtaskd Not tainted 6.10.0-rc3 #19
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
Call Trace:
 <TASK>
 panic+0x2f3/0x320
 watchdog+0x2dd/0x510
 ? __pfx_watchdog+0x10/0x10
 kthread+0xe0/0x110
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x2f/0x40
 ? __pfx_kthread+0x10/0x10
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Signed-off-by: Yongliang Gao <leonylgao@tencent.com>
Reviewed-by: Huang Cun <cunhuang@tencent.com>
---
 kernel/hung_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index 1d92016b0b3c..6ca859715d8a 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -127,7 +127,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",
-- 
2.39.3


                 reply	other threads:[~2024-06-13  3:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240613033159.3446265-1-leonylgao@gmail.com \
    --to=leonylgao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cunhuang@tencent.com \
    --cc=j.granados@samsung.com \
    --cc=jsiddle@redhat.com \
    --cc=kent.overstreet@linux.dev \
    --cc=leonylgao@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®