Re: [PATCH RESEND v2 0/3] hung_task: extend blocking task stacktrace dump to semaphore
From: Lance Yang
Date: Fri Mar 14 2025 - 23:19:17 EST
On Sat, Mar 15, 2025 at 1:38 AM Boqun Feng <boqun.feng@xxxxxxxxx> wrote:
>
> Hi Lance,
>
> On Fri, Mar 14, 2025 at 10:42:57PM +0800, Lance Yang wrote:
> > Hi all,
> >
> > Inspired by mutex blocker tracking[1], this patch series extend the
> > feature to not only dump the blocker task holding a mutex but also to
> > support semaphores. Unlike mutexes, semaphores lack explicit ownership
> > tracking, making it challenging to identify the root cause of hangs. To
> > address this, we introduce a last_holder field to the semaphore structure,
> > which is updated when a task successfully calls down() and cleared during
> > up().
> >
> > The assumption is that if a task is blocked on a semaphore, the holders
> > must not have released it. While this does not guarantee that the last
> > holder is one of the current blockers, it likely provides a practical hint
> > for diagnosing semaphore-related stalls.
> >
>
> Could you copy John Stultz for the future versions? Because John is
> working on proxy execution, which will make a task always track which
> mutex it's blocked by:
>
> https://lore.kernel.org/lkml/20250312221147.1865364-3-jstultz@xxxxxxxxxx/
>
> I feel it's better to build the hung task detection with that in mind,
> thanks!
Yeah. Thanks for letting me know. I will keep John in the loop ;)
Thanks,
Lance
>
> Regards,
> Boqun
>
> [...]