From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Yu Kuai <yukuai1@huaweicloud.com>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH 4/5] brd: split I/O at page boundaries
Date: Tue, 29 Apr 2025 14:17:36 -0700 [thread overview]
Message-ID: <aBFB8JDESV1V4epi@kbusch-mbp> (raw)
In-Reply-To: <20250429121529.GB12411@lst.de>
On Tue, Apr 29, 2025 at 02:15:29PM +0200, Christoph Hellwig wrote:
> On Tue, Apr 29, 2025 at 09:38:28AM +0800, Yu Kuai wrote:
> > Hi,
> >
> > 在 2025/04/29 2:07, Keith Busch 写道:
> >> On Mon, Apr 28, 2025 at 07:09:50AM -0700, Christoph Hellwig wrote:
> >>> A lot of complexity in brd stems from the fact that it tries to handle
> >>> I/O spanning two backing pages. Instead limit the size of a single
> >>> bvec iteration so that it never crosses a page boundary and remove all
> >>> the now unneeded code.
> >>
> >> Doesn't bio_for_each_segment() already limit bvecs on page boundaries?
> >> You'd need to use bio_for_each_bvec() to get multi-page bvecs.
> >
> > I think it only limit bvecs on page boundaries on the issue side, not
> > disk side.
> >
> > For example, if user issue an IO (2k + 4k), will bio_for_each_segment()
> > split this IO into (2k + 2k) and (4k + 2k), I do not test yet, but I
> > think the answer is no.
>
> Exactly. I got this wrong with zram, where it only triggers with larger
> than 4k page sizes, and I got this wrong here on my first attempt as
> well. Fortunately testing found it quickly. I thought the comment and
> commit message document the issue well enough, but I'm open to better
> wording.
Ah, it just clicked for me that you're talking about the pages returned
from brd_lookup_page (the "backing pages", as you said), not the bio's
pages. Sorry about that.
next prev parent reply other threads:[~2025-04-29 21:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 14:09 brd cleanups v2 Christoph Hellwig
2025-04-28 14:09 ` [PATCH 1/5] brd: pass a bvec pointer to brd_do_bvec Christoph Hellwig
2025-04-28 14:09 ` [PATCH 2/5] brd: remove the sector variable in brd_submit_bio Christoph Hellwig
2025-04-28 14:09 ` [PATCH 3/5] brd: use bvec_kmap_local in brd_do_bvec Christoph Hellwig
2025-04-28 14:09 ` [PATCH 4/5] brd: split I/O at page boundaries Christoph Hellwig
2025-04-28 18:07 ` Keith Busch
2025-04-29 1:38 ` Yu Kuai
2025-04-29 12:15 ` Christoph Hellwig
2025-04-29 21:17 ` Keith Busch [this message]
2025-04-28 14:09 ` [PATCH 5/5] brd: use memcpy_{to,from]_page in brd_rw_bvec Christoph Hellwig
2025-04-28 15:30 ` brd cleanups v2 Johannes Thumshirn
2025-04-28 17:46 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2025-04-21 7:26 brd cleanups Christoph Hellwig
2025-04-21 7:26 ` [PATCH 4/5] brd: split I/O at page boundaries Christoph Hellwig
2025-04-22 9:30 ` Hannes Reinecke
2025-04-22 11:10 ` Yu Kuai
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=aBFB8JDESV1V4epi@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.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