btrfs: voluntarily relinquish cpu when doing a full fsync
authorFilipe Manana <fdmanana@suse.com>
Thu, 17 Feb 2022 12:12:05 +0000 (12:12 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 15:20:04 +0000 (16:20 +0100)
commitba3e4236c4e3ed82f44369703f87b3214d967fc4
treeaa674b0587af9b9cbc410f4bd273af3dad6b7259
parentebfaced841253d50fe151c98cf3967f9eaec52b3
btrfs: voluntarily relinquish cpu when doing a full fsync

Doing a full fsync may require processing many leaves of metadata, which
can take some time and result in a task monopolizing a cpu for too long.
So add a cond_resched() after processing a leaf when doing a full fsync,
while not holding any locks on any tree (a subvolume or a log tree).

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c