Skip to content

btrfs: enhancement to pass generic/563

Qu Wenruo linux-btrfs linux-mm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Rebased to the latest for-next branch
There is a data corruption read fix, which changed the timing of btrfs_lock_and_flush_ordered_range().

- Introduce a dedicated and smarted, read path speific extent range lock helper, lock_extents_for_read()
Which has all the extra subpage specific deadlock avoiding mechanism, along with a much better comments on which type of ordered extents needs to be waited, and which can be completely skipped.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: introduce a read path dedicated extent lock helperfs/btrfs/defrag.c fs/btrfs/direct-io.c fs/btrfs/extent_io.c +4 more+210 -172 replies
2/3btrfs: make btrfs_do_readpage() to do block-by-block readfs/btrfs/extent_io.c+12 -251 reply
3/3btrfs: allow buffered write to avoid full page read if it's block alignedfs/btrfs/extent_io.c fs/btrfs/file.c+7 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] btrfs: enhancement to pass generic/563

[CHANGELOG]
v2:
- Rebased to the latest for-next branch
There is a data corruption read fix, which changed the timing of btrfs_lock_and_flush_ordered_range().

- Introduce a dedicated and smarted, read path speific extent range lock helper, lock_extents_for_read()
Which has all the extra subpage specific deadlock avoiding mechanism, along with a much better comments on which type of ordered extents needs to be waited, and which can be completely skipped.

The test case generic/563 on aarch64 with 64K page size and 4K fs block size will fail with btrfs, but not EXT4 nor XFS.

The detailed reason is explained in the last patch, the TL;DR is that btrfs is not handling block aligned buffered write in an optimized way for subpage cases (block size < page size).

The first patch is to address the deadlock-prone btrfs_lock_and_flush_ordered_range() in read paths, by introduce a deadlock-avoiding helper for read paths.

The second patch is a refactor in preparation for the new enhancement.

Eventually the last patch will enable the enhancement and pass the generic/563.

Qu Wenruo (3):
btrfs: introduce a read path dedicated extent lock helper
btrfs: make btrfs_do_readpage() to do block-by-block read
btrfs: allow buffered write to avoid full page read if it's block
aligned

 fs/btrfs/defrag.c       |   2 +-
 fs/btrfs/direct-io.c    |   2 +-
 fs/btrfs/extent_io.c    | 224 +++++++++++++++++++++++++++++++++++-----
 fs/btrfs/file.c         |   9 +-
 fs/btrfs/inode.c        |   4 +-
 fs/btrfs/ordered-data.c |  29 ++++--
 fs/btrfs/ordered-data.h |   3 +-
 7 files changed, 229 insertions(+), 44 deletions(-)
Signature · 1 line
2.48.1