]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
writeback: Avoid softlockup when switching many inodes
authorJan Kara <jack@suse.cz>
Fri, 12 Sep 2025 10:38:36 +0000 (12:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:23:22 +0000 (16:23 +0200)
commit68be7f61083768e88521492093139277c98ba87f
treee620fe2304a13bf4adfa201c4f926ea1accc8860
parentcd572b903a21af8a5a05d7932acd337bc0f4ea03
writeback: Avoid softlockup when switching many inodes

[ Upstream commit 66c14dccd810d42ec5c73bb8a9177489dfd62278 ]

process_inode_switch_wbs_work() can be switching over 100 inodes to a
different cgroup. Since switching an inode requires counting all dirty &
under-writeback pages in the address space of each inode, this can take
a significant amount of time. Add a possibility to reschedule after
processing each inode to avoid softlockups.

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fs-writeback.c