Commit 08ef566
btrfs: zoned: remove redundant space_info lock and variable in do_allocation_zoned()
In do_allocation_zoned(), the code acquires space_info->lock before
block_group->lock. However, the critical section does not access or
modify any members of the space_info structure. Thus, the lock is
redundant as it provides no necessary synchronization here.
This change simplifies the locking logic and aligns the function with
other zoned paths, such as __btrfs_add_free_space_zoned(), which only
rely on block_group->lock. Since the 'space_info' local variable is
no longer used after removing the lock calls, it is also removed.
Removing this unnecessary lock reduces contention on the global
space_info lock, improving concurrency in the zoned allocation path.
Reviewed-by: Boris Burkov <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Naohiro Aota <[email protected]>
Signed-off-by: Jiasheng Jiang <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 6141abb commit 08ef566
1 file changed
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4013 | 4013 | | |
4014 | 4014 | | |
4015 | 4015 | | |
4016 | | - | |
4017 | | - | |
4018 | | - | |
| 4016 | + | |
| 4017 | + | |
4019 | 4018 | | |
4020 | 4019 | | |
4021 | 4020 | | |
| |||
4028 | 4027 | | |
4029 | 4028 | | |
4030 | 4029 | | |
4031 | | - | |
4032 | 4030 | | |
4033 | 4031 | | |
4034 | 4032 | | |
| |||
4089 | 4087 | | |
4090 | 4088 | | |
4091 | 4089 | | |
4092 | | - | |
4093 | 4090 | | |
4094 | 4091 | | |
4095 | 4092 | | |
| |||
4191 | 4188 | | |
4192 | 4189 | | |
4193 | 4190 | | |
4194 | | - | |
4195 | 4191 | | |
4196 | 4192 | | |
4197 | 4193 | | |
| |||
0 commit comments