diff options
| author | Filipe Manana <fdmanana@suse.com> | 2025-10-17 17:47:59 +0300 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-11-25 00:07:26 +0300 |
| commit | a5f8f64aa3377b470945252f926e2cbb5a931c11 (patch) | |
| tree | 98acaad73551525809e6372bc863579595b80daa /include/linux/memory_hotplug.h | |
| parent | 563ef2befb55a75ba13b66d9714d50b848de8aae (diff) | |
| download | linux-a5f8f64aa3377b470945252f926e2cbb5a931c11.tar.xz | |
btrfs: avoid used space computation when trying to grant tickets
In btrfs_try_granting_tickets(), we call btrfs_can_overcommit() and that
calls btrfs_space_info_used(). But we already keep track, in the 'used'
local variable, of the used space in the space_info, so we are just
repeating the same computation and doing an extra function call while we
are holding the space_info's spinlock, which is heavily used by the space
reservation and flushing code.
So add a local variant of btrfs_can_overcommit() that takes in the used
space as an argument and therefore does not call btrfs_space_info_used(),
and use it in btrfs_try_granting_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/linux/memory_hotplug.h')
0 files changed, 0 insertions, 0 deletions
