]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
writeback: Fix wakeup and logging timeouts for !DETECT_HUNG_TASK
authorHuacai Chen <chenhuacai@loongson.cn>
Tue, 3 Feb 2026 09:40:14 +0000 (17:40 +0800)
committerChristian Brauner <brauner@kernel.org>
Sat, 14 Feb 2026 12:17:46 +0000 (13:17 +0100)
commit9eed043d10f17301c1b5141e16bb98a85a8fd07e
tree41c0c6e1439c29ba288bad1410c7ef4c6f659ce8
parentcb184dd19154fc486fa3d9e02afe70a97e54e055
writeback: Fix wakeup and logging timeouts for !DETECT_HUNG_TASK

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@loongson.cn>
Link: https://patch.msgid.link/20260203094014.2273240-1-chenhuacai@loongson.cn
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/fs-writeback.c