Re: [PATCH v3 2/2] hung_task: Enable runtime reset of hung_task_detect_count
From: Aaron Tomlin
Date: Sun Dec 21 2025 - 16:27:03 EST
On Thu, Dec 18, 2025 at 10:08:07AM +0100, Joel Granados wrote:
> Would it make more sense to write it like this:
>
> Indicates the total number of tasks that have been detected as hung
> since the system boot or since the counter was reset. Counter is
> zeroed when written to.
Hi Joel,
Thank you for the feedback.
> > That's okay, I think. See vmstat_refresh() for a similar pattern - it
> You are correct but wouldn't it make more sense to zero it out only when
> the write value passed by the user is zero. And return -EINVAL for any
> other value?
I entirely agree with your assessment: only a value of zero should be
considered valid for resetting sysctl_hung_task_detect_count. Any attempt
by a user to write a non-zero value should be rejected with a return of
-EINVAL. This approach provides a much more intuitive interface.
Kind regards,
--
Aaron Tomlin