summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichal Rostecki <mrostecki@suse.com>2021-01-27 14:57:27 +0100
committerDavid Sterba <dsterba@suse.com>2021-02-08 22:59:00 +0100
commit420343131970fd29db129b308612f9364b06df0b (patch)
tree973c0c539d607271392e11f5b1afa3c3ddb26cd5 /scripts
parent951c80f83d61bd4b21794c8aba829c3c1a45c2d0 (diff)
downloadlinux-420343131970fd29db129b308612f9364b06df0b.tar.bz2
btrfs: let callers of btrfs_get_io_geometry pass the em
Before this change, the btrfs_get_io_geometry() function was calling btrfs_get_chunk_map() to get the extent mapping, necessary for calculating the I/O geometry. It was using that extent mapping only internally and freeing the pointer after its execution. That resulted in calling btrfs_get_chunk_map() de facto twice by the __btrfs_map_block() function. It was calling btrfs_get_io_geometry() first and then calling btrfs_get_chunk_map() directly to get the extent mapping, used by the rest of the function. Change that to passing the extent mapping to the btrfs_get_io_geometry() function as an argument. This could improve performance in some cases. For very large filesystems, i.e. several thousands of allocated chunks, not only this avoids searching two times the rbtree, saving time, it may also help reducing contention on the lock that protects the tree - thinking of writeback starting for multiple inodes, other tasks allocating or removing chunks, and anything else that requires access to the rbtree. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Michal Rostecki <mrostecki@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> [ add Filipe's analysis ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions