Re: [PATCH 12/22] iomap: better read bounce buffering support

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-xfs,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Thu, Jul 23, 2026 at 02:10:04PM -0700, Darrick J. Wong wrote:
> On Thu, Jul 23, 2026 at 04:49:37PM +0200, Christoph Hellwig wrote:
> > Add helpers to bounce buffer an upper bio into one or more lower bios
> > using bounce buffers, and to copy the data back on completion.
> > 
> > Compared to the existing IOMAP_DIO_BOUNCE support for read bios, this
> > has two advantages:  by removing the special bounce bio_vec it allows
> > to the full and "round" size of a single bio, i.e., 1MiB when using
> > 4k pages.  This is important for good performance on HDD.  Additionally
> > it allows to bounce buffer a bio from completion conext, and thus
> > implement a "lazy" bounce buffering scheme, where the data is only
> > read into a bounce buffer after an initial checksum validation failure,
> > thus avoiding the bounce buffering I/O for most I/O.
> > 
> > Signed-off-by: Christoph Hellwig <[email protected]>
> 
> Now that I can see how this is used ("xfs: add support for lazy direct
> read bounce buffering") I think I'm ok with this.  Should there be some
> Documentation/ about how to use PI with iomap?

Maybe.  Although I'd rather have a second example first before coming
up with definitively guidlines.  Note that even without fs pi they
should use bounce buffering for devices that require stable pages to
avoid corruption, but no one has been particularly interested (well,
minus btrfs where the native checksums make it more common).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.