Re: [PATCH V3] writeback: Fix wakeup and logging timeouts for !DETECT_HUNG_TASK

From: Pankaj Raghav (Samsung)

Date: Tue Feb 03 2026 - 09:04:23 EST


On Tue, Feb 03, 2026 at 05:40:14PM +0800, Huacai Chen wrote:
> Recent changes of fs-writeback cause such warnings if DETECT_HUNG_TASK
> is not enabled:
>
> INFO: The task sync:1342 has been waiting for writeback completion for more than 1 seconds.
>
> The reason is sysctl_hung_task_timeout_secs is 0 when DETECT_HUNG_TASK
> is not enabled, then it causes the warning message even if the writeback
> lasts for only one second.
>
> Guard the wakeup and logging with "#ifdef CONFIG_DETECT_HUNG_TASK" can
> eliminate the warning messages. But on the other hand, it is possible
> that sysctl_hung_task_timeout_secs be also 0 when DETECT_HUNG_TASK is
> enabled. So let's just check the value of sysctl_hung_task_timeout_secs
> to decide whether do wakeup and logging.
>
> Fixes: 1888635532fb ("writeback: Wake up waiting tasks when finishing the writeback of a chunk.")
> Fixes: d6e621590764 ("writeback: Add logging for slow writeback (exceeds sysctl_hung_task_timeout_secs)")
> Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
> ---
> V2: Disable wakeup and logging for !DETECT_HUNG_TASK.
> V3: Also handle the case for DETECT_HUNG_TASK if sysctl_hung_task_timeout_secs is 0.

Looks good,
Reviewed-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
--
Pankaj