]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: increment loop count outside critical section during metadata reclaim
authorFilipe Manana <fdmanana@suse.com>
Fri, 17 Oct 2025 15:54:12 +0000 (16:54 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:09:14 +0000 (22:09 +0100)
commit8ab2b8bdbecaaf1b01adc5cfc13534a04917515d
treedd459c7509b75b9f56728db83ec00e9e8766963d
parent49f204be223b8bae5dd3d99f86c1ea649ce58aab
btrfs: increment loop count outside critical section during metadata reclaim

In btrfs_preempt_reclaim_metadata_space() there's no need to increment the
local variable that tracks the number of iterations of the while loop
while inside the critical section delimited by the space_info's spinlock.
That spinlock is heavily used by space reservation and flushing code, so
it's desirable to have its critical sections as short as possible.
So move the loop count incremented outside the critical section.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c