From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Christian Brauner <brauner@kernel.org>,
Carlos Maiolino <cem@kernel.org>, Qu Wenruo <wqu@suse.com>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-block@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 07/14] iomap: simplify iomap_dio_bio_iter
Date: Thu, 15 Jan 2026 07:20:01 +0100 [thread overview]
Message-ID: <20260115062001.GE9205@lst.de> (raw)
In-Reply-To: <20260114225123.GL15551@frogsfrogsfrogs>
On Wed, Jan 14, 2026 at 02:51:23PM -0800, Darrick J. Wong wrote:
> On Wed, Jan 14, 2026 at 08:41:05AM +0100, Christoph Hellwig wrote:
> > Use iov_iter_count to check if we need to continue as that just reads
> > a field in the iov_iter, and only use bio_iov_vecs_to_alloc to calculate
> > the actual number of vectors to allocate for the bio.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Huh, interesting. bio_iov_vecs_to_alloc returns 0 if the iov_iter is of
> type bvec, so I guess we'd only run the loop body once before, and with
> zero pages? Hrmm, that doesn't seem right.
>
> Does that mean that we could always construct a bio for the entire bvec?
> Or does that just mean that directio doesn't get called with a bvec
> iterator?
>
> Or, basic question: what the heck is a bvec? A bio_vec? So perhaps
> iomap_dio_bio_iter can't be called with a bio_vec because we're
> constructing a bio, not dealing with an existing one?
>
> <have the cold meds kicked in yet?>
bio_iov_iter_get_pages reused the passed in bio_vec (yes, _bvec stands
for an array of bio_vecs) for iov_iter_is_bvec iters. bios haver no
real size limit, although lower layers can't deal with more than
BIO_MAX_VECS vectors in a bunch of places.
So when bio_iov_iter_get_pages calls bio_iov_bvec_set for bvec iters,
there is an implicit assumption that it has less than BIO_MAX_VECS
vectors. We should probably make that explicit, but I'll keep that
separate from this series.
next prev parent reply other threads:[~2026-01-15 6:20 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 7:40 bounce buffer direct I/O when stable pages are required Christoph Hellwig
2026-01-14 7:40 ` [PATCH 01/14] block: refactor get_contig_folio_len Christoph Hellwig
2026-01-14 7:41 ` [PATCH 02/14] block: open code bio_add_page and fix handling of mismatching P2P ranges Christoph Hellwig
2026-01-14 12:46 ` Johannes Thumshirn
2026-01-14 13:01 ` hch
2026-01-14 7:41 ` [PATCH 03/14] iov_iter: extract a iov_iter_extract_bvecs helper from bio code Christoph Hellwig
2026-01-14 7:41 ` [PATCH 04/14] block: remove bio_release_page Christoph Hellwig
2026-01-14 7:41 ` [PATCH 05/14] block: add helpers to bounce buffer an iov_iter into bios Christoph Hellwig
2026-01-14 12:51 ` Johannes Thumshirn
2026-01-14 7:41 ` [PATCH 06/14] iomap: fix submission side handling of completion side errors Christoph Hellwig
2026-01-14 22:35 ` Darrick J. Wong
2026-01-15 6:17 ` Christoph Hellwig
2026-01-14 7:41 ` [PATCH 07/14] iomap: simplify iomap_dio_bio_iter Christoph Hellwig
2026-01-14 22:51 ` Darrick J. Wong
2026-01-15 6:20 ` Christoph Hellwig [this message]
2026-01-14 7:41 ` [PATCH 08/14] iomap: split out the per-bio logic from iomap_dio_bio_iter Christoph Hellwig
2026-01-14 22:53 ` Darrick J. Wong
2026-01-14 7:41 ` [PATCH 09/14] iomap: share code between iomap_dio_bio_end_io and iomap_finish_ioend_direct Christoph Hellwig
2026-01-14 22:54 ` Darrick J. Wong
2026-01-14 7:41 ` [PATCH 10/14] iomap: free the bio before completing the dio Christoph Hellwig
2026-01-14 22:55 ` Darrick J. Wong
2026-01-15 6:21 ` Christoph Hellwig
2026-01-14 7:41 ` [PATCH 11/14] iomap: rename IOMAP_DIO_DIRTY to IOMAP_DIO_USER_BACKED Christoph Hellwig
2026-01-14 22:56 ` Darrick J. Wong
2026-01-14 7:41 ` [PATCH 12/14] iomap: support ioends for direct reads Christoph Hellwig
2026-01-14 22:57 ` Darrick J. Wong
2026-01-15 6:21 ` Christoph Hellwig
2026-01-14 7:41 ` [PATCH 13/14] iomap: add a flag to bounce buffer direct I/O Christoph Hellwig
2026-01-14 22:59 ` Darrick J. Wong
2026-01-15 6:21 ` Christoph Hellwig
2026-01-14 7:41 ` [PATCH 14/14] xfs: use bounce buffering direct I/O when the device requires stable pages Christoph Hellwig
2026-01-14 23:07 ` Darrick J. Wong
2026-01-15 6:24 ` Christoph Hellwig
2026-01-14 9:52 ` bounce buffer direct I/O when stable pages are required Qu Wenruo
2026-01-14 12:39 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2026-01-19 7:44 bounce buffer direct I/O when stable pages are required v2 Christoph Hellwig
2026-01-19 7:44 ` [PATCH 07/14] iomap: simplify iomap_dio_bio_iter Christoph Hellwig
2026-01-19 17:43 ` Darrick J. Wong
2026-01-23 8:55 ` Damien Le Moal
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=20260115062001.GE9205@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=wqu@suse.com \
/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