summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-10-17 16:57:27 +0300
committerDavid Sterba <dsterba@suse.com>2025-11-25 00:05:06 +0300
commit60532c2136ea205c5db0a622e1a51420c8530d0f (patch)
tree3967acb2a5481cfe16ee00a012253b9a9763703f /include
parent063171a4f0fa25fe47331b4fee3f705484f1c690 (diff)
downloadlinux-60532c2136ea205c5db0a622e1a51420c8530d0f.tar.xz
btrfs: avoid recomputing used space in btrfs_try_granting_tickets()
In every iteration of the loop we call btrfs_space_info_used() which sums a bunch of fields from a space_info object. This implies doing a function call besides the sum, and we are holding the space_info's spinlock while we do this, so we want to keep the critical section as short as possible since that spinlock is used in all the code for space reservation and flushing (therefore it's heavily used). So call btrfs_try_granting_tickets() only once, before entering the loop, and then update it as we remove tickets. 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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions