[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250313152946.69f209c76a6f479c46584ef0@linux-foundation.org>
Date: Thu, 13 Mar 2025 15:29:46 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>, Boqun Feng <boqun.feng@...il.com>, Waiman
Long <longman@...hat.com>, Joel Granados <joel.granados@...nel.org>, Anna
Schumaker <anna.schumaker@...cle.com>, Lance Yang <ioworker0@...il.com>,
Kent Overstreet <kent.overstreet@...ux.dev>, Yongliang Gao
<leonylgao@...cent.com>, Steven Rostedt <rostedt@...dmis.org>, Tomasz Figa
<tfiga@...omium.org>, Sergey Senozhatsky <senozhatsky@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] hung_task: Show the blocker task if the task is
hung on mutex
On Tue, 25 Feb 2025 16:02:34 +0900 "Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>
> The "hung_task" shows a long-time uninterruptible slept task, but most
> often, it's blocked on a mutex acquired by another task. Without
> dumping such a task, investigating the root cause of the hung task
> problem is very difficult.
>
> This introduce task_struct::blocker_mutex to point the mutex lock
> which this task is waiting for. Since the mutex has "owner"
> information, we can find the owner task and dump it with hung tasks.
>
> Note: the owner can be changed while dumping the owner task, so
> this is "likely" the owner of the mutex.
>
> With this change, the hung task shows blocker task's info like below;
Seems useful.
> ...
>
> +static void debug_show_blocker(struct task_struct *task)
> +{
>
> ...
>
> +}
> +#else
> +#define debug_show_blocker(t) do {} while (0)
> +#endif
> +
Nit. It's unpleasing to have one side a C function and the other a
macro. Plus C functions are simply better - only use a macro if one
has to!
So,
--- a/kernel/hung_task.c~hung_task-show-the-blocker-task-if-the-task-is-hung-on-mutex-fix
+++ a/kernel/hung_task.c
@@ -125,7 +125,9 @@ static void debug_show_blocker(struct ta
}
}
#else
-#define debug_show_blocker(t) do {} while (0)
+static inline void debug_show_blocker(struct task_struct *task)
+{
+}
#endif
static void check_hung_task(struct task_struct *t, unsigned long timeout)
_
Powered by blists - more mailing lists