writeback: Avoid softlockup when switching many inodes

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>
This commit is contained in:
Jan Kara 2025-09-12 12:38:36 +02:00 • committed by Christian Brauner
commit 66c14dccd8
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2