btrfs: basic refactor of btrfs_buffered_write()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 2 repliesIn review
- v23 patches 5 repliesSuperseded
- v13 patches 0 repliesSuperseded
Changes in v3 from the cover letter
- Rename get_nr_pages() to calc_nr_pages()
- Remove unnecessary parameter for calc_nr_pages()
- Change the upper limit of calc_nr_pages() in a separate patch
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | btrfs: refactor @nrptrs calculation of btrfs_buffered_write()fs/ | +20 | 0 replies | |
| 2/4 | btrfs: refactor btrfs_buffered_write() into process_one_batch()fs/ | +216 | 0 replies | |
| 3/4 | btrfs: remove the again: tag in process_one_batch()fs/ | +86 | 0 replies | |
| 4/4 | btrfs: avoid allocating unnecessary page pointersfs/ | +8 | 0 replies |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Josef Bacik |
|---|---|
| 1/4 | |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] btrfs: basic refactor of btrfs_buffered_write()
This patchset will refactor btrfs_buffered_write() by:
- Extra the nrptrs calculation into one function
The main concern here is the batch number of pages. Originally there is a max(nrptrs, 8), which looks so incorrect that my eyes change it to min(nrptrs, 8) automatically.
This time we kill that max(nrptrs, 8), and replace it to a fixed size up limit (64K), which should bring the same performance for different page sized.
The limit can be changed if the 64K is not large enough for certain buffered write.
- Refactor the main loop into process_one_batch()
No functional change, just plain refactor.
- Remove the again: tag by integrating page and extent locking The new function lock_pages_and_extent() will handle the retry so we don't need the tag any more in the main loop.
Changelog:
v2:
- Fix a bug that ENOSPC error is not returned to user space It's caused by a missing assignment for (copied < 0) branch in the 2nd patch.
v3:
- Rename get_nr_pages() to calc_nr_pages()
- Remove unnecessary parameter for calc_nr_pages()
- Change the upper limit of calc_nr_pages() in a separate patch
Qu Wenruo (4):
btrfs: refactor @nrptrs calculation of btrfs_buffered_write()
btrfs: refactor btrfs_buffered_write() into process_one_batch()
btrfs: remove the again: tag in process_one_batch()
btrfs: avoid allocating unnecessary page pointers
fs/btrfs/file.c | 572 ++++++++++++++++++++++++++---------------------- 1 file changed, 305 insertions(+), 267 deletions(-)
Signature · 1 line
2.28.0