From: Petr Mladek <pmladek@suse.com>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: akpm@linux-foundation.org, lance.yang@linux.dev,
mhiramat@kernel.org, gregkh@linuxfoundation.org,
joel.granados@kernel.org, neelx@suse.com, sean@ashe.io,
mproche@gmail.com, chjohnst@gmail.com, nick.lange@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [v7 PATCH 1/2] hung_task: Refactor detection logic and atomicise detection count
Date: Mon, 2 Feb 2026 13:59:17 +0100 [thread overview]
Message-ID: <aYCfpS--vgVMzYWU@pathway> (raw)
In-Reply-To: <20260125135848.3356585-2-atomlin@atomlin.com>
On Sun 2026-01-25 08:58:47, Aaron Tomlin wrote:
> The check_hung_task() function currently conflates two distinct
> responsibilities: validating whether a task is hung and handling the
> subsequent reporting (printing warnings, triggering panics, or
> tracepoints).
>
> This patch refactors the logic by introducing hung_task_info(), a
> function dedicated solely to reporting. The actual detection check,
> task_is_hung(), is hoisted into the primary loop within
> check_hung_uninterruptible_tasks(). This separation clearly decouples
> the mechanism of detection from the policy of reporting.
>
> Furthermore, to facilitate future support for concurrent hung task
> detection, the global sysctl_hung_task_detect_count variable is
> converted from unsigned long to atomic_long_t. Consequently, the
> counting logic is updated to accumulate the number of hung tasks locally
> (this_round_count) during the iteration. The global counter is then
> updated atomically via atomic_long_cmpxchg_relaxed() once the loop
> concludes, rather than incrementally during the scan.
>
> These changes are strictly preparatory and introduce no functional
> change to the system's runtime behaviour.
>
> Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
LGTM. Feel free to use:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2026-02-02 12:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-25 13:58 [v7 PATCH 0/2] hung_task: Provide runtime reset interface for hung task detector Aaron Tomlin
2026-01-25 13:58 ` [v7 PATCH 1/2] hung_task: Refactor detection logic and atomicise detection count Aaron Tomlin
2026-02-02 6:10 ` Masami Hiramatsu
2026-02-02 12:59 ` Petr Mladek [this message]
2026-02-03 3:05 ` Lance Yang
2026-02-03 3:08 ` Lance Yang
2026-02-03 9:03 ` Petr Mladek
2026-02-03 11:01 ` Lance Yang
2026-02-04 11:04 ` [PATCH] hung_task: Increment the global counter immediately Petr Mladek
2026-02-04 11:21 ` Lance Yang
2026-02-04 14:00 ` Aaron Tomlin
2026-02-04 18:05 ` Andrew Morton
2026-02-06 20:54 ` Aaron Tomlin
2026-02-07 6:10 ` Lance Yang
2026-02-04 14:07 ` [v7 PATCH 1/2] hung_task: Refactor detection logic and atomicise detection count Aaron Tomlin
2026-01-25 13:58 ` [v7 PATCH 2/2] hung_task: Enable runtime reset of hung_task_detect_count Aaron Tomlin
2026-02-02 6:09 ` Masami Hiramatsu
2026-02-02 13:26 ` Petr Mladek
2026-02-01 19:48 ` [v7 PATCH 0/2] hung_task: Provide runtime reset interface for hung task detector Aaron Tomlin
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=aYCfpS--vgVMzYWU@pathway \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@atomlin.com \
--cc=chjohnst@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel.granados@kernel.org \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mproche@gmail.com \
--cc=neelx@suse.com \
--cc=nick.lange@gmail.com \
--cc=sean@ashe.io \
/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