All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH 4/7] blk-mq: when polling for IO, look for any completion
Date: Mon, 19 Nov 2018 00:02:33 -0800	[thread overview]
Message-ID: <20181119080233.GD9622@infradead.org> (raw)
In-Reply-To: <20181117214354.822-5-axboe@kernel.dk>

> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 52b1c97cd7c6..3ca00d712158 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -3266,9 +3266,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>  	 *  0:	use half of prev avg
>  	 * >0:	use this specific value
>  	 */
> -	if (q->poll_nsec == -1)
> -		return false;
> -	else if (q->poll_nsec > 0)
> +	if (q->poll_nsec > 0)
>  		nsecs = q->poll_nsec;
>  	else
>  		nsecs = blk_mq_poll_nsecs(q, hctx, rq);

The above comment now doesn't match the code here as the -1 case
is handled elsewhere.

> +static int __blk_mq_poll(struct blk_mq_hw_ctx *hctx)
>  {
>  	struct request_queue *q = hctx->queue;
>  	long state;

Can you merge __blk_mq_poll into blk_mq_poll now that blk_mq_poll
is pretty trivial?

>  static void nvme_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
>  {
> -	__nvme_rdma_recv_done(cq, wc, -1);
> +	__nvme_rdma_recv_done(cq, wc);
>  }

__nvme_rdma_recv_done and nvme_rdma_recv_done can be merged now.

>  static int nvme_rdma_conn_established(struct nvme_rdma_queue *queue)
> @@ -1758,10 +1752,12 @@ static int nvme_rdma_poll(struct blk_mq_hw_ctx *hctx, unsigned int tag)
>  		struct ib_cqe *cqe = wc.wr_cqe;
>  
>  		if (cqe) {
> -			if (cqe->done == nvme_rdma_recv_done)
> -				found |= __nvme_rdma_recv_done(cq, &wc, tag);
> -			else
> +			if (cqe->done == nvme_rdma_recv_done) {
> +				__nvme_rdma_recv_done(cq, &wc);
> +				found++;
> +			} else {
>  				cqe->done(cq, &wc);
> +			}

And we should probably look into separate poll queues for RDMA as well
while we're at it.

WARNING: multiple messages have this Message-ID (diff)
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH 4/7] blk-mq: when polling for IO, look for any completion
Date: Mon, 19 Nov 2018 00:02:33 -0800	[thread overview]
Message-ID: <20181119080233.GD9622@infradead.org> (raw)
In-Reply-To: <20181117214354.822-5-axboe@kernel.dk>

> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 52b1c97cd7c6..3ca00d712158 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -3266,9 +3266,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
>  	 *  0:	use half of prev avg
>  	 * >0:	use this specific value
>  	 */
> -	if (q->poll_nsec == -1)
> -		return false;
> -	else if (q->poll_nsec > 0)
> +	if (q->poll_nsec > 0)
>  		nsecs = q->poll_nsec;
>  	else
>  		nsecs = blk_mq_poll_nsecs(q, hctx, rq);

The above comment now doesn't match the code here as the -1 case
is handled elsewhere.

> +static int __blk_mq_poll(struct blk_mq_hw_ctx *hctx)
>  {
>  	struct request_queue *q = hctx->queue;
>  	long state;

Can you merge __blk_mq_poll into blk_mq_poll now that blk_mq_poll
is pretty trivial?

>  static void nvme_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
>  {
> -	__nvme_rdma_recv_done(cq, wc, -1);
> +	__nvme_rdma_recv_done(cq, wc);
>  }

__nvme_rdma_recv_done and nvme_rdma_recv_done can be merged now.

>  static int nvme_rdma_conn_established(struct nvme_rdma_queue *queue)
> @@ -1758,10 +1752,12 @@ static int nvme_rdma_poll(struct blk_mq_hw_ctx *hctx, unsigned int tag)
>  		struct ib_cqe *cqe = wc.wr_cqe;
>  
>  		if (cqe) {
> -			if (cqe->done == nvme_rdma_recv_done)
> -				found |= __nvme_rdma_recv_done(cq, &wc, tag);
> -			else
> +			if (cqe->done == nvme_rdma_recv_done) {
> +				__nvme_rdma_recv_done(cq, &wc);
> +				found++;
> +			} else {
>  				cqe->done(cq, &wc);
> +			}

And we should probably look into separate poll queues for RDMA as well
while we're at it.

  reply	other threads:[~2018-11-19  8:02 UTC|newest]

Thread overview: 48+ 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 ` Jens Axboe
2018-11-17 21:43 ` [PATCH 1/7] block: avoid ordered task state change for polled IO Jens Axboe
2018-11-17 21:43   ` Jens Axboe
2018-11-19  7:58   ` Christoph Hellwig
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-17 21:43   ` Jens Axboe
2018-11-19  7:58   ` Christoph Hellwig
2018-11-19  7:58     ` Christoph Hellwig
2018-11-25 10:52   ` Sagi Grimberg
2018-11-25 10:52     ` Sagi Grimberg
2018-11-25 13:41     ` Jens Axboe
2018-11-25 13:41       ` Jens Axboe
2018-11-27 10:10       ` Sagi Grimberg
2018-11-27 10:10         ` Sagi Grimberg
2018-11-27 15:20         ` Jens Axboe
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-17 21:43   ` Jens Axboe
2018-11-19  7:59   ` Christoph Hellwig
2018-11-19  7:59     ` Christoph Hellwig
2018-11-19 15:19     ` Jens Axboe
2018-11-19 15:19       ` Jens Axboe
2018-11-19 19:00       ` James Smart
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-17 21:43   ` Jens Axboe
2018-11-19  8:02   ` Christoph Hellwig [this message]
2018-11-19  8:02     ` Christoph Hellwig
2018-11-19 15:20     ` Jens Axboe
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-17 21:43   ` Jens Axboe
2018-11-19  8:02   ` Christoph Hellwig
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-17 21:43   ` Jens Axboe
2018-11-19  8:05   ` Christoph Hellwig
2018-11-19  8:05     ` Christoph Hellwig
2018-11-19 15:21     ` Jens Axboe
2018-11-19 15:21       ` Jens Axboe
2018-11-20  9:11       ` Sagi Grimberg
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-17 21:43   ` Jens Axboe
2018-11-19  8:05   ` Christoph Hellwig
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=20181119080233.GD9622@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.