btrfs: raid56: concurrency fix and a very tiny optimization
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 3 repliesIn review
Changes in v2 from the cover letter
- Use set_bit() in a loop instead of an asymmetrical spinlock. Since only endio can have concurrency accessing the bitmap, while the main thread only access them in a single thread, we will have asymmetrical spinlock schema, which is not ideal. Instead go set_bit() in a loop.
- Add a tiny optimization to calculate bio length in rbio_update_error_bitmap()
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: raid56: make error_bitmap update atomicfs/ | +10 | 1 reply | |
| 2/2 | btrfs: raid56: reduce the overhead to calculate the bio lengthfs/ | +1 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] btrfs: raid56: concurrency fix and a very tiny optimization
We have a unprotected concurrency updateing rbio::error_bitmap. The first patch is going to fix it.
While we are at rbio_update_error_bitmap(), there is also a tiny optimization we can do for calculating the bio size.
Since we only care about the size of the bio, bio_for_each_bvec_all() is much better than bio_for_each_segment_all(), as the former one can handle multi-page bvec directly to reduce the loop.
Changelog:
v2:
- Use set_bit() in a loop instead of an asymmetrical spinlock. Since only endio can have concurrency accessing the bitmap, while the main thread only access them in a single thread, we will have asymmetrical spinlock schema, which is not ideal. Instead go set_bit() in a loop.
- Add a tiny optimization to calculate bio length in rbio_update_error_bitmap()
Qu Wenruo (2):
btrfs: raid56: make error_bitmap update atomic
btrfs: raid56: reduce the overhead to calculate the bio length
fs/btrfs/raid56.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
Signature · 1 line
2.39.1