From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
io-uring@vger.kernel.org, linux-mm@kvack.org,
Leon Romanovsky <leon@kernel.org>
Subject: Re: [PATCH] block: Add bvec_folio()
Date: Mon, 25 May 2026 14:29:27 +0100 [thread overview]
Message-ID: <ahROtyLcr567wM8l@casper.infradead.org> (raw)
In-Reply-To: <ahPm4h2gKgyEEuvV@infradead.org>
On Sun, May 24, 2026 at 11:06:26PM -0700, Christoph Hellwig wrote:
> > +/**
> > + * bvec_folio - Return the first folio referenced by this bvec
> > + * @bv: bvec to access
> > + *
> > + * bvecs can span multiple folios. Unless you know that this
> > + * bvec does not, you may be better off using something like
> > + * bio_for_each_folio_all() which iterates over all folios.
> > + */
> > +static inline struct folio *bvec_folio(const struct bio_vec *bv)
> > +{
> > + return page_folio(bv->bv_page);
> > +}
>
> The comment here is confusing. bio_for_each_folio_all is a helper that
> only works in the submitter side, and not for anything using the
> bvec_iter required for drivers or anything else sitting below a
> potential bio clone/split or using bvecs from an upper layer (like
> ITER_BVEC direct I/O). Additionally bv_page can be a different
> page than the fist page due to large bv_offset on split bios.
>
> So I'm not against the function per se, but the documentation must
> explain the minefields it is stepping into a bit better.
Lower level drivers shouldn't be concerning themselves with folios.
For a start, we can put non-folios (eg slab memory) into bvecs.
I'm happy to clarify this comment further, but I don't understand
who's going to look at this function and need to have more explanation.
next prev parent reply other threads:[~2026-05-25 13:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 18:21 Matthew Wilcox (Oracle)
2026-05-25 6:06 ` Christoph Hellwig
2026-05-25 13:29 ` Matthew Wilcox [this message]
2026-05-26 6:43 ` Christoph Hellwig
2026-05-26 17:47 ` Matthew Wilcox
2026-05-27 6:22 ` Christoph Hellwig
2026-05-27 15:54 ` Matthew Wilcox
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=ahROtyLcr567wM8l@casper.infradead.org \
--to=willy@infradead.org \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=io-uring@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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
all inboxes | Powered by JetHome®