From: Jens Axboe <axboe@kernel.dk>
To: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Ming Lei <ming.lei@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
linux-block@vger.kernel.org, Coly Li <colyli@suse.de>,
Keith Busch <kbusch@kernel.org>,
linux-bcache@vger.kernel.org
Subject: Re: [PATCH V4] block: optimize for small block size IO
Date: Mon, 4 Nov 2019 20:33:32 -0700 [thread overview]
Message-ID: <e0d76d36-157a-138e-12c1-a3f1e318f71c@kernel.dk> (raw)
In-Reply-To: <20191105031417.GA5872@moria.home.lan>
On 11/4/19 8:14 PM, Kent Overstreet wrote:
> On Mon, Nov 04, 2019 at 07:38:42PM -0700, Jens Axboe wrote:
>> This is where my knee jerk at the initial "partial completions" and
>> "should be trivial" start to kick in. I don't think they are
>> necessarily hard, but they aren't free either. And you'd need to be
>> paying that atomic_dec cost for every IO.
>
> No need - you added the code to avoid that atomic dec for bi_remaining
> in the common case, the same approach will work here.
I guess that would work for the common case of not splitting. If we split,
then it's OK to pay a higher cost. We would have anyway, with the
existing code.
>> currently have to do, maybe not... If it's a clear win, then it'd be
>> an interesting path to pursue. But we probably won't have that answer
>> until at least a hacky version is done as proof of concept.
>>
>> On the upside, it'd simplify things to just have the mapping in one
>> place, when the request is setup. Though until all drivers do that
>> (which I worry will be never), then we'd be stuck with both. Maybe
>> that's a bit to pessimistic, should be easier now since we just have
>> blk-mq.
>
> blk_rq_map_sg isn't called from _that_ many places, I suspect once
> it's figured out for one driver the rest won't be that bad.
It's definitely easier than it would have been, most things are pretty
streamlined now with the blk-mq conversion. And the ones that don't call
blk_rq_map_sg() usually don't do DMA on the requests. Sizes tend to be
more arbitrary there, and not hard boundaries.
> And even if some drivers remain unconverted, I personally _much_
> prefer this approach to more special case fast paths, and I bet this
> approach will be faster anyways.
>
> Also - regarding driver allocating of the sglists, I think most high
> performance drivers preallocate a pool of sglists that are all sized
> to what the device is capable of.
They do, but most of them probably also assume on sg list per request.
We'd have one request now instead of multiple, so either serializing it
(which would definitely suck for some common cases), or doing something
very funky with mapping to multiple requests at the same time.
But I don't think we should argue this much more. If someone wants to do
the work to make this work, even a prototype, it's much better to argue
over actual code then potential issues and wins now.
--
Jens Axboe
next prev parent reply other threads:[~2019-11-05 3:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-02 7:29 [PATCH V4] block: optimize for small block size IO Ming Lei
2019-11-02 14:03 ` Jens Axboe
2019-11-02 15:57 ` Jens Axboe
2019-11-04 0:01 ` Ming Lei
2019-11-04 18:14 ` Kent Overstreet
2019-11-04 18:15 ` Christoph Hellwig
2019-11-04 18:17 ` Kent Overstreet
2019-11-04 18:23 ` Jens Axboe
2019-11-04 18:42 ` Kent Overstreet
2019-11-05 1:11 ` Ming Lei
2019-11-05 2:11 ` Kent Overstreet
2019-11-05 2:20 ` Ming Lei
2019-11-05 2:30 ` Kent Overstreet
2019-11-05 2:38 ` Jens Axboe
2019-11-05 3:14 ` Kent Overstreet
2019-11-05 3:33 ` Jens Axboe [this message]
2019-11-05 2:46 ` Ming Lei
2019-11-05 2:49 ` Jens Axboe
2019-11-05 3:34 ` Ming Lei
2019-11-05 0:44 ` Ming Lei
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=e0d76d36-157a-138e-12c1-a3f1e318f71c@kernel.dk \
--to=axboe@kernel.dk \
--cc=colyli@suse.de \
--cc=hch@infradead.org \
--cc=kbusch@kernel.org \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.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