From: Ming Lei <ming.lei@redhat.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Christoph Hellwig <hch@lst.de>,
Matthew Wilcox <willy@infradead.org>,
Hongbo Li <lihongbo22@huawei.com>,
linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-block@vger.kernel.org, axboe@kernel.dk
Subject: Re: bvec_iter.bi_sector -> loff_t? (was: Re: [PATCH] bcachefs: allow direct io fallback to buffer io for) unaligned length or offset
Date: Fri, 21 Jun 2024 11:36:20 +0800 [thread overview]
Message-ID: <ZnT1NGI7jcI//en+@fedora> (raw)
In-Reply-To: <6b45ixfmsxdsza6csmlnoatuv24ja3ffdp6lzijfhyjyylfofs@4tpl66qhxrr7>
On Thu, Jun 20, 2024 at 11:07:19PM -0400, Kent Overstreet wrote:
> On Fri, Jun 21, 2024 at 09:48:11AM +0800, Ming Lei wrote:
> > On Thu, Jun 20, 2024 at 11:43:44AM -0400, Kent Overstreet wrote:
> > > On Thu, Jun 20, 2024 at 05:30:50PM +0200, Christoph Hellwig wrote:
> > > > On Thu, Jun 20, 2024 at 02:54:09PM +0100, Matthew Wilcox wrote:
> > > > > I'm against it. Block devices only do sector-aligned IO and we should
> > > > > not pretend otherwise.
> > > >
> > > > While I agree with that, the bvec_iter is actually used in a few other
> > > > places and could be used in more, and the 512-byte sector unit bi_sector
> > > > is the only weird thing that's not useful elsewhere. So turning that
> > > > into a
> > > >
> > > > u64 bi_addr;
> > > >
> > > > that is byte based where the meaning is specific to the user would
> > > > actually be kinda nice. For traditional block users we'd need a
> > > > bio_sector() helpers similar to the existing bio_sectors() one,
> > > > but a lot of non-trivial drivers actually need to translated to
> > > > a variable LBA-based addressing, which would be (a tiny little bit)
> > > > simpler with the byte address. As bi_size is already in bytes
> > > > it would also fit in pretty naturally with that.
> > > >
> > > > The only thing that is really off putting is the amount of churn that
> > > > this would cause.
> > >
> > > I'm being imprecise when I just say 'struct bio'; there's things in
> > > there that are block layer specific but there are also things in there
> > > you want that aren't block layer specific (completion callback, write
> > > flags, s/bi_bdev/bi_inode and that as well, perhaps). It's not at all
> > > clear to me we'd want to deal with the churn to split that up or make
> > > bio itself less block layer specific (although, but when I say 'aiming
> > > for commality with struct bio' that sort of thing is what I have in
> > > mind.
> > >
> > > But more immediately, yes - bi_addr as all we need for this, and like
> > > you said I think it'd be a worthwhile change.
> >
> > Still not clear why you need unaligned bi_addr for bio, if this bio needs
> > to call submit_bio(), it has to be aligned. Otherwise, you could invent any
> > structure for this purpose, and the structure can be payload of bio for
> > avoiding extra allocation, even it can be FS generic structure.
>
> We want to have fewer scatter/gather list data structures, not more.
OK, that look fine to change to bi_addr since bvec_iter is widely used now,
maybe .bi_sector can be moved into bio, cause bvec iterator needn't it.
Thanks,
Ming
next prev parent reply other threads:[~2024-06-21 3:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 13:21 [PATCH] bcachefs: allow direct io fallback to buffer io for unaligned length or offset Hongbo Li
2024-06-20 13:36 ` bvec_iter.bi_sector -> loff_t? (was: Re: [PATCH] bcachefs: allow direct io fallback to buffer io for) " Kent Overstreet
2024-06-20 13:54 ` Matthew Wilcox
2024-06-20 14:16 ` Kent Overstreet
2024-06-20 14:49 ` Matthew Wilcox
2024-06-20 14:56 ` bvec_iter.bi_sector -> loff_t? Jens Axboe
2024-06-20 15:15 ` Matthew Wilcox
2024-06-20 15:18 ` Jens Axboe
2024-06-20 16:26 ` Keith Busch
2024-06-20 15:20 ` Christoph Hellwig
2024-06-20 15:21 ` Jens Axboe
2024-06-21 2:37 ` Hongbo Li
2024-06-21 3:05 ` Kent Overstreet
2024-06-20 15:35 ` bvec_iter.bi_sector -> loff_t? (was: Re: [PATCH] bcachefs: allow direct io fallback to buffer io for) unaligned length or offset Kent Overstreet
2024-06-21 3:13 ` bvec_iter.bi_sector -> loff_t? Hongbo Li
2024-06-20 15:30 ` bvec_iter.bi_sector -> loff_t? (was: Re: [PATCH] bcachefs: allow direct io fallback to buffer io for) unaligned length or offset Christoph Hellwig
2024-06-20 15:43 ` Kent Overstreet
2024-06-21 1:48 ` Ming Lei
2024-06-21 3:07 ` Kent Overstreet
2024-06-21 3:36 ` Ming Lei [this message]
2024-06-21 3:52 ` Kent Overstreet
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=ZnT1NGI7jcI//en+@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kent.overstreet@linux.dev \
--cc=lihongbo22@huawei.com \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=willy@infradead.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