aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorQu Wenruo <[email protected]>2023-09-01 02:11:16 +0000
committerDavid Sterba <[email protected]>2023-10-12 14:44:03 +0000
commit79ace7b807281ed4c9c4a847ef9bce71a4f5fa97 (patch)
tree9210656670c679b58574cfcae81c3e042cf97f29 /fs/btrfs/dev-replace.c
parentbtrfs: qgroup: pre-allocate btrfs_qgroup to reduce GFP_ATOMIC usage (diff)
downloadkernel-79ace7b807281ed4c9c4a847ef9bce71a4f5fa97.tar.gz
kernel-79ace7b807281ed4c9c4a847ef9bce71a4f5fa97.zip
btrfs: qgroup: prealloc btrfs_qgroup_list for __add_relation_rb()
Currently we go GFP_ATOMIC allocation for qgroup relation add, this includes the following 3 call sites: - btrfs_read_qgroup_config() This is not really needed, as at that time we're still in single thread mode, and no spin lock is held. - btrfs_add_qgroup_relation() This one is holding a spinlock, but we're ensured to add at most one relation, thus we can easily do a preallocation and use the preallocated memory to avoid GFP_ATOMIC. - btrfs_qgroup_inherit() This is a little more tricky, as we may have as many relationships as inherit::num_qgroups. Thus we have to properly allocate an array then preallocate all the memory. This patch would remove the GFP_ATOMIC allocation for above involved call sites, by doing preallocation before holding the spinlock, and let __add_relation_rb() to handle the freeing of the structure. Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions