From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH 2/7] block: have ->poll_fn() return number of entries polled
Date: Sun, 25 Nov 2018 06:41:45 -0700 [thread overview]
Message-ID: <ba2d191c-cf9d-07f1-5875-6a07ef043949@kernel.dk> (raw)
In-Reply-To: <fb1200ad-35ef-1c2e-25cf-d8a71bc505b5@grimberg.me>
On 11/25/18 3:52 AM, Sagi Grimberg wrote:
>> We currently only really support sync poll, ie poll with 1
>> IO in flight. This prepares us for supporting async poll.
>
> Hey Jens,
>
> So are we sure that this is fine to simply replace the
> poll functionality? you say that that we support poll
> with only 1 I/O inflight but is it entirely true?
> semantically speaking?
It is, unless you have multiple threads all doing polling. Which is
pretty inefficient, as I'm sure you know.
> The interface is selective polling, which means that
> the user can have more than a single I/O inflight but wants
> to poll for a specific one that it really cares about.
>
> Would this introduce a regression for users that rely
> on preadv2 to basically "complete *this* IO as fast as possible"?
No, it'll be exactly the same, and believe me, I've done plenty of
performance testing to ensure that it works well. In fact, with the
changes queued up and this on top, polling is both faster and more
efficient than it ever has been before, for both the classic
preadv2/pwritev2 and the async polled IO.
> Note that I like the proposed direction, I'm merely questioning
> if it is OK to simply change how selective polling worked until
> today instead of introducing a separate blk_poll_all(q) (but with
> a better name) which would be wired up to aio polling and friends.
I think that would be useless. For SYNC type polling with one thread, it
doesn't matter if we're looking for a particular IO, or just any IO.
Once your into two threads, you're already wasting huge amounts of CPU,
just to get to QD=2. The poll loop handles finding each others IOs just
fine, so there's no worry on that side.
Polling was originally designed for the strictly SYNC interfaces, and
since we had the cookie anyway, it was tempting to look for a specific
IO. I think that was a mistake, as it assumed that we'd never do async
polling.
--
Jens Axboe
next prev parent reply other threads:[~2018-11-25 13:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-17 21:43 [PATCHSET v4] Various block optimizations Jens Axboe
2018-11-17 21:43 ` [PATCH 1/7] block: avoid ordered task state change for polled IO Jens Axboe
2018-11-19 7:58 ` Christoph Hellwig
2018-11-17 21:43 ` [PATCH 2/7] block: have ->poll_fn() return number of entries polled Jens Axboe
2018-11-19 7:58 ` Christoph Hellwig
2018-11-25 10:52 ` Sagi Grimberg
2018-11-25 13:41 ` Jens Axboe [this message]
2018-11-27 10:10 ` Sagi Grimberg
2018-11-27 15:20 ` Jens Axboe
2018-11-17 21:43 ` [PATCH 3/7] nvme-fc: remove unused poll implementation Jens Axboe
2018-11-19 7:59 ` Christoph Hellwig
2018-11-19 15:19 ` Jens Axboe
2018-11-19 19:00 ` James Smart
2018-11-17 21:43 ` [PATCH 4/7] blk-mq: when polling for IO, look for any completion Jens Axboe
2018-11-19 8:02 ` Christoph Hellwig
2018-11-19 15:20 ` Jens Axboe
2018-11-17 21:43 ` [PATCH 5/7] blk-mq: remove 'tag' parameter from mq_ops->poll() Jens Axboe
2018-11-19 8:02 ` Christoph Hellwig
2018-11-17 21:43 ` [PATCH 6/7] block: make blk_poll() take a parameter on whether to spin or not Jens Axboe
2018-11-19 8:05 ` Christoph Hellwig
2018-11-19 15:21 ` Jens Axboe
2018-11-20 9:11 ` Sagi Grimberg
2018-11-17 21:43 ` [PATCH 7/7] blk-mq: ensure mq_ops ->poll() is entered at least once Jens Axboe
2018-11-19 8:05 ` Christoph Hellwig
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=ba2d191c-cf9d-07f1-5875-6a07ef043949@kernel.dk \
--to=axboe@kernel.dk \
/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;
as well as URLs for NNTP newsgroup(s).