Re: [v6 PATCH 2/2] hung_task: Enable runtime reset of hung_task_detect_count
From: Lance Yang
Date: Thu Jan 15 2026 - 21:11:12 EST
On 2026/1/16 02:24, Aaron Tomlin wrote:
On Thu, Jan 15, 2026 at 11:06:16AM +0800, Lance Yang wrote:
I see hung_task_diagnostics() is still in this patch. I thought
we'd concluded that[1] the refactoring wasn't really necessary for a
single-use block?
[1] https://lore.kernel.org/all/noze3vhqjbsuulvvoaw4h5yeinggpwfslrit5vsd2dllfo4ath@qgmp22hoibgn/
Hi Lance,
Please accept my apologies for the oversight; I certainly did not intend to
disregard our previous conclusion regarding the refactoring.
However, in light of the additional modifications suggested by Petr, it
appeared to me that re-introducing hung_task_diagnostics() resulted in a
significantly cleaner implementation. By encapsulating the diagnostic
output logic, we separate the formatting concerns from the control flow,
which seemed to improve the overall readability of the function.
That being said, if you still consider this abstraction to be redundant, I
am entirely amenable to dropping it and reverting to the inline approach.
Please let me know your preference.
Thanks for explaining!
Personally, I still do not think the helper is necessary here.
Especially for a single-use block, the abstraction doesn't add much
value.
The inline version is actually more straightforward - you can see
the diagnostic output right where it's used without jumping to another
function.
Please drop the helper and keep that code inline :)