lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250314125700.86cc80f6cc51af636f453056@kernel.org>
Date: Fri, 14 Mar 2025 12:57:00 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.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 Thu, 13 Mar 2025 15:29:46 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:

> 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!

Ah, that's nice to know. Thanks for the fix!

> 
> 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)
> _
> 


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ