From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v4 0/4] btrfs: enable encoded read/write/send for bs > ps cases
Date: Tue, 11 Nov 2025 09:11:57 +1030 [thread overview]
Message-ID: <cover.1762814274.git.wqu@suse.com> (raw)
[CHANGELOG]
v4:
- Rebased to the latest for-next branch
The new async-csum is causing conflicts related to
btrfs_csum_one_bio() and how to grab fs_info from compressed_bio.
v3:
- Fix a bug in btrfs_repair_eb_io_failure() for nodesize < ps cases
In that case, we only need a single paddr slot, but a larger step
(nodesize instead of sectorsize).
Add a new @step parameter to btrfs_repair_io_failure() to handle this
special situation.
v2:
- Fix smatch warnings
Mostly remove any ASSERT()s checking returned value of bio_alloc().
- Fix a bug in the btrfs_add_compressed_bio_folios()
Where the function still assumes large folios, but now we can have
regular folios.
Previously encoded read/write/send is disabled for bs > ps cases,
because they are either using regular pages or kvmallocated memories as
buffer.
This means their buffers do not meet the folio size requirement (each
folio much contain at least one fs block, no block can cross large folio
boundries).
This series address the limits by allowing the following functionalities
to support regular pages, without relying on large folios:
- Checksum calculation
Now instead of passing a single @paddr which is ensured to be inside a
large folio, an array, paddrs[], is passed in.
For bs <= ps cases, it's still a single paddr.
For bs > ps cases, we can accept an array of multiple paddrs, that
represents a single fs block.
- Read repair
Allow btrfs_repair_io_failure() to submit a bio with multiple
incontiguous pages.
The same paddrs[] array building scheme.
But this time since we need to submit a bio with multiple bvecs, we
can no longer use the current on-stack bio.
This also brings a small improvement for metadata read-repair, we can
submit the whole metadata block in one go.
- Comprssed bio folios submission
Now the function btrfs_add_compressed_bio_folios() can handle both
large and regular folios, even handling different sized folios in the
array.
- Read verification
Just build the paddrs[] array for bs > ps cases and pass the array
into btrfs_calculate_block_csum_folio().
Unfortunately since there is no reliable on-stack VLA support, we have
to pay the extra on-stack memory (128 bytes for x86_64, or 8 bytes for
64K page sized systems) everywhere, even if 99% of the cases our block
size is no larger than page size.
The remaining part of full bs > ps support is:
- Direct IO support for bs > ps
This depends on a patch that is going through iomap/vfs tree instead.
Thus that part will only go through the v6.19 cycle
- RAID56 support
Which depends on the follow series which reduces btrfs_raid_bio size:
https://lore.kernel.org/linux-btrfs/cover.1759984060.git.wqu@suse.com/
Qu Wenruo (4):
btrfs: make btrfs_csum_one_bio() handle bs > ps without large folios
btrfs: make btrfs_repair_io_failure() handle bs > ps cases without
large folios
btrfs: make read verification handle bs > ps cases without large
folios
btrfs: enable encoded read/write/send for bs > ps cases
fs/btrfs/bio.c | 140 +++++++++++++++++++++++++++++------------
fs/btrfs/bio.h | 5 +-
fs/btrfs/btrfs_inode.h | 8 ++-
fs/btrfs/compression.c | 10 +--
fs/btrfs/disk-io.c | 29 +++++----
fs/btrfs/file-item.c | 15 ++++-
fs/btrfs/inode.c | 91 ++++++++++++++++++---------
fs/btrfs/ioctl.c | 21 -------
fs/btrfs/send.c | 9 +--
9 files changed, 207 insertions(+), 121 deletions(-)
--
2.51.2
next reply other threads:[~2025-11-10 22:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 22:41 Qu Wenruo [this message]
2025-11-10 22:41 ` [PATCH v4 1/4] btrfs: make btrfs_csum_one_bio() handle bs > ps without large folios Qu Wenruo
2025-11-10 22:41 ` [PATCH v4 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases " Qu Wenruo
2025-11-10 22:42 ` [PATCH v4 3/4] btrfs: make read verification " Qu Wenruo
2025-11-10 22:42 ` [PATCH v4 4/4] btrfs: enable encoded read/write/send for bs > ps cases Qu Wenruo
2025-11-12 16:24 ` [PATCH v4 0/4] " David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1762814274.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox