From: Kanchan Joshi <joshiiitr@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>,
Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Yuanyuan Zhong <yzhong@purestorage.com>,
Casey Chen <cachen@purestorage.com>
Subject: Re: [PATCHv2 1/5] block: support polling through blk_execute_rq
Date: Mon, 17 May 2021 22:13:50 +0530 [thread overview]
Message-ID: <CA+1E3r+3dDW0Hbc8MCsxAnwcpY=kWAqDLh0h9+j501VnKvgwqA@mail.gmail.com> (raw)
In-Reply-To: <20210423220558.40764-2-kbusch@kernel.org>
On Sat, Apr 24, 2021 at 3:37 AM Keith Busch <kbusch@kernel.org> wrote:
>
> Poll for completions if the request's hctx is a polling type.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> block/blk-exec.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/block/blk-exec.c b/block/blk-exec.c
> index beae70a0e5e5..b960ad187ba5 100644
> --- a/block/blk-exec.c
> +++ b/block/blk-exec.c
> @@ -63,6 +63,11 @@ void blk_execute_rq_nowait(struct gendisk *bd_disk, struct request *rq,
> }
> EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);
>
> +static bool blk_rq_is_poll(struct request *rq)
> +{
> + return rq->mq_hctx && rq->mq_hctx->type == HCTX_TYPE_POLL;
> +}
> +
> /**
> * blk_execute_rq - insert a request into queue for execution
> * @bd_disk: matching gendisk
> @@ -83,7 +88,12 @@ void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
>
> /* Prevent hang_check timer from firing at us during very long I/O */
> hang_check = sysctl_hung_task_timeout_secs;
> - if (hang_check)
> + if (blk_rq_is_poll(rq)) {
> + do {
> + blk_poll(rq->q, request_to_qc_t(rq->mq_hctx, rq), true);
> + cond_resched();
> + } while (!completion_done(&wait));
> + } else if (hang_check)
> while (!wait_for_completion_io_timeout(&wait, hang_check * (HZ/2)));
> else
> wait_for_completion_io(&wait);
> --
Looks good.
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
--
Kanchan
next prev parent reply other threads:[~2021-05-17 16:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 22:05 [PATCHv2 0/5] block and nvme passthrough error handling Keith Busch
2021-04-23 22:05 ` [PATCHv2 1/5] block: support polling through blk_execute_rq Keith Busch
2021-04-26 6:34 ` Ming Lei
2021-04-26 14:35 ` Christoph Hellwig
2021-05-17 16:43 ` Kanchan Joshi [this message]
2021-04-23 22:05 ` [PATCHv2 2/5] nvme: use blk_execute_rq() for passthrough commands Keith Busch
2021-04-26 14:35 ` Christoph Hellwig
2021-04-23 22:05 ` [PATCHv2 3/5] block: return errors from blk_execute_rq() Keith Busch
2021-04-26 6:42 ` Ming Lei
2021-04-26 14:36 ` Christoph Hellwig
2021-04-23 22:05 ` [PATCHv2 4/5] nvme: use return value " Keith Busch
2021-04-26 14:42 ` Christoph Hellwig
2021-04-26 17:10 ` Yuanyuan Zhong
2021-04-26 17:15 ` Keith Busch
2021-04-26 17:39 ` Yuanyuan Zhong
2021-04-23 22:05 ` [PATCHv2 5/5] nvme: allow user passthrough commands to poll Keith Busch
2021-04-26 14:43 ` Christoph Hellwig
2021-04-26 15:15 ` Keith Busch
2021-05-17 16:55 ` Kanchan Joshi
2021-05-17 17:14 ` Keith Busch
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='CA+1E3r+3dDW0Hbc8MCsxAnwcpY=kWAqDLh0h9+j501VnKvgwqA@mail.gmail.com' \
--to=joshiiitr@gmail.com \
--cc=axboe@kernel.dk \
--cc=cachen@purestorage.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=yzhong@purestorage.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;
as well as URLs for NNTP newsgroup(s).