From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Mike Snitzer <snitzer@redhat.com>
Cc: linux-block@vger.kernel.org,
Jeffle Xu <jefflexu@linux.alibaba.com>,
dm-devel@redhat.com, Hannes Reinecke <hare@suse.de>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [RFC PATCH V2 3/3] dm: support bio polling
Date: Fri, 18 Jun 2021 07:08:59 +0800 [thread overview]
Message-ID: <YMvWC2vNCsnTkfrc@T590> (raw)
In-Reply-To: <20210617103549.930311-4-ming.lei@redhat.com>
On Thu, Jun 17, 2021 at 06:35:49PM +0800, Ming Lei wrote:
> Support bio(REQ_POLLED) polling in the following approach:
>
> 1) only support io polling on normal READ/WRITE, and other abnormal IOs
> still fallback on IRQ mode, so the target io is exactly inside the dm
> io.
>
> 2) hold one refcnt on io->io_count after submitting this dm bio with
> REQ_POLLED
>
> 3) support dm native bio splitting, any dm io instance associated with
> current bio will be added into one list which head is bio->bi_end_io
> which will be recovered before ending this bio
>
> 4) implement .poll_bio() callback, call bio_poll() on the single target
> bio inside the dm io which is retrieved via bio->bi_bio_drv_data; call
> dec_pending() after the target io is done in .poll_bio()
>
> 4) enable QUEUE_FLAG_POLL if all underlying queues enable QUEUE_FLAG_POLL,
> which is based on Jeffle's previous patch.
>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
...
> @@ -938,8 +945,12 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
> end_io_acct(io);
> free_io(md, io);
>
> - if (io_error == BLK_STS_DM_REQUEUE)
> + if (io_error == BLK_STS_DM_REQUEUE) {
> + /* not poll any more in case of requeue */
> + if (bio->bi_opf & REQ_POLLED)
> + bio->bi_opf &= ~REQ_POLLED;
It becomes not necessary to clear REQ_POLLED before requeuing since
every dm_io is added into the hlist_head which is reused from
bio->bi_end_io, so all dm-io(include the one to be requeued) will be
polled.
Thanks,
Ming
next prev parent reply other threads:[~2021-06-17 23:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 10:35 [RFC PATCH V2 0/3] block/dm: support bio polling Ming Lei
2021-06-17 10:35 ` [RFC PATCH V2 1/3] block: add helper of blk_queue_poll Ming Lei
2021-06-21 7:20 ` Christoph Hellwig
2021-06-21 8:38 ` Ming Lei
2021-06-17 10:35 ` [RFC PATCH V2 2/3] block: add ->poll_bio to block_device_operations Ming Lei
2021-06-21 7:25 ` Christoph Hellwig
2021-06-21 8:41 ` Ming Lei
2021-06-17 10:35 ` [RFC PATCH V2 3/3] dm: support bio polling Ming Lei
2021-06-17 23:08 ` Ming Lei [this message]
2021-06-18 8:19 ` [dm-devel] " JeffleXu
2021-06-18 13:29 ` Ming Lei
2021-06-18 14:39 ` Ming Lei
2021-06-18 20:56 ` Mike Snitzer
2021-06-19 0:27 ` Ming Lei
2021-06-21 1:32 ` JeffleXu
2021-06-21 11:33 ` [dm-devel] " JeffleXu
2021-06-21 14:04 ` Ming Lei
2021-06-22 2:26 ` JeffleXu
2021-06-22 2:45 ` Ming Lei
2021-06-22 7:45 ` JeffleXu
2021-06-30 8:30 ` Ming Lei
2021-06-21 7:36 ` Christoph Hellwig
2021-06-21 9:09 ` 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=YMvWC2vNCsnTkfrc@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-block@vger.kernel.org \
--cc=snitzer@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