All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH 3/8] blk-mq: add mq_ops->commit_rqs()
Date: Wed, 28 Nov 2018 09:38:54 +0800	[thread overview]
Message-ID: <20181128013852.GD11128@ming.t460p> (raw)
In-Reply-To: <20181126163556.5181-4-axboe@kernel.dk>

On Mon, Nov 26, 2018 at 09:35:51AM -0700, Jens Axboe wrote:
> blk-mq passes information to the hardware about any given request being
> the last that we will issue in this sequence. The point is that hardware
> can defer costly doorbell type writes to the last request. But if we run
> into errors issuing a sequence of requests, we may never send the request
> with bd->last == true set. For that case, we need a hook that tells the
> hardware that nothing else is coming right now.
> 
> For failures returned by the drivers ->queue_rq() hook, the driver is
> responsible for flushing pending requests, if it uses bd->last to
> optimize that part. This works like before, no changes there.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>  include/linux/blk-mq.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index ca0520ca6437..1fd139b65a6e 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -117,6 +117,7 @@ struct blk_mq_queue_data {
>  
>  typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
>  		const struct blk_mq_queue_data *);
> +typedef void (commit_rqs_fn)(struct blk_mq_hw_ctx *);
>  /* takes rq->cmd_flags as input, returns a hardware type index */
>  typedef int (rq_flags_to_type_fn)(struct request_queue *, unsigned int);
>  typedef bool (get_budget_fn)(struct blk_mq_hw_ctx *);
> @@ -144,6 +145,15 @@ struct blk_mq_ops {
>  	 */
>  	queue_rq_fn		*queue_rq;
>  
> +	/*
> +	 * If a driver uses bd->last to judge when to submit requests to
> +	 * hardware, it must define this function. In case of errors that
> +	 * make us stop issuing further requests, this hook serves the
> +	 * purpose of kicking the hardware (which the last request otherwise
> +	 * would have done).
> +	 */
> +	commit_rqs_fn		*commit_rqs;
> +
>  	/*
>  	 * Return a queue map type for the given request/bio flags
>  	 */
> -- 
> 2.17.1
>

Looks fine,

Reviewed-by: Ming Lei <ming.lei@redhat.com>

Thanks,
Ming

WARNING: multiple messages have this Message-ID (diff)
From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH 3/8] blk-mq: add mq_ops->commit_rqs()
Date: Wed, 28 Nov 2018 09:38:54 +0800	[thread overview]
Message-ID: <20181128013852.GD11128@ming.t460p> (raw)
In-Reply-To: <20181126163556.5181-4-axboe@kernel.dk>

On Mon, Nov 26, 2018@09:35:51AM -0700, Jens Axboe wrote:
> blk-mq passes information to the hardware about any given request being
> the last that we will issue in this sequence. The point is that hardware
> can defer costly doorbell type writes to the last request. But if we run
> into errors issuing a sequence of requests, we may never send the request
> with bd->last == true set. For that case, we need a hook that tells the
> hardware that nothing else is coming right now.
> 
> For failures returned by the drivers ->queue_rq() hook, the driver is
> responsible for flushing pending requests, if it uses bd->last to
> optimize that part. This works like before, no changes there.
> 
> Signed-off-by: Jens Axboe <axboe at kernel.dk>
> ---
>  include/linux/blk-mq.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index ca0520ca6437..1fd139b65a6e 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -117,6 +117,7 @@ struct blk_mq_queue_data {
>  
>  typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
>  		const struct blk_mq_queue_data *);
> +typedef void (commit_rqs_fn)(struct blk_mq_hw_ctx *);
>  /* takes rq->cmd_flags as input, returns a hardware type index */
>  typedef int (rq_flags_to_type_fn)(struct request_queue *, unsigned int);
>  typedef bool (get_budget_fn)(struct blk_mq_hw_ctx *);
> @@ -144,6 +145,15 @@ struct blk_mq_ops {
>  	 */
>  	queue_rq_fn		*queue_rq;
>  
> +	/*
> +	 * If a driver uses bd->last to judge when to submit requests to
> +	 * hardware, it must define this function. In case of errors that
> +	 * make us stop issuing further requests, this hook serves the
> +	 * purpose of kicking the hardware (which the last request otherwise
> +	 * would have done).
> +	 */
> +	commit_rqs_fn		*commit_rqs;
> +
>  	/*
>  	 * Return a queue map type for the given request/bio flags
>  	 */
> -- 
> 2.17.1
>

Looks fine,

Reviewed-by: Ming Lei <ming.lei at redhat.com>

Thanks,
Ming

  parent reply	other threads:[~2018-11-28  1:39 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 16:35 [PATCHSET 0/8] block plugging improvements Jens Axboe
2018-11-26 16:35 ` Jens Axboe
2018-11-26 16:35 ` [PATCH 1/8] block: sum requests in the plug structure Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-26 17:02   ` Christoph Hellwig
2018-11-26 17:02     ` Christoph Hellwig
2018-11-26 16:35 ` [PATCH 2/8] block: improve logic around when to sort a plug list Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-27 23:31   ` Omar Sandoval
2018-11-27 23:31     ` Omar Sandoval
2018-11-27 23:49     ` Jens Axboe
2018-11-27 23:49       ` Jens Axboe
2018-11-27 23:55       ` Omar Sandoval
2018-11-27 23:55         ` Omar Sandoval
2018-11-27 23:59       ` Jens Axboe
2018-11-27 23:59         ` Jens Axboe
2018-11-28  0:05         ` Omar Sandoval
2018-11-28  0:05           ` Omar Sandoval
2018-11-28  0:16           ` Jens Axboe
2018-11-28  0:16             ` Jens Axboe
2018-11-26 16:35 ` [PATCH 3/8] blk-mq: add mq_ops->commit_rqs() Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-27 23:43   ` Omar Sandoval
2018-11-27 23:43     ` Omar Sandoval
2018-11-28  1:38   ` Ming Lei [this message]
2018-11-28  1:38     ` Ming Lei
2018-11-28  7:16   ` Christoph Hellwig
2018-11-28  7:16     ` Christoph Hellwig
2018-11-28 12:54     ` Jens Axboe
2018-11-28 12:54       ` Jens Axboe
2018-11-26 16:35 ` [PATCH 4/8] nvme: implement mq_ops->commit_rqs() hook Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-28  7:20   ` Christoph Hellwig
2018-11-28  7:20     ` Christoph Hellwig
2018-11-28 13:07     ` Jens Axboe
2018-11-28 13:07       ` Jens Axboe
2018-11-26 16:35 ` [PATCH 5/8] virtio_blk: " Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-27 23:45   ` Omar Sandoval
2018-11-27 23:45     ` Omar Sandoval
2018-11-28  3:05     ` Michael S. Tsirkin
2018-11-28  3:05       ` Michael S. Tsirkin
2018-11-28  2:10   ` Ming Lei
2018-11-28  2:10     ` Ming Lei
2018-11-28  2:34     ` Jens Axboe
2018-11-28  2:34       ` Jens Axboe
2018-11-29  1:23       ` Ming Lei
2018-11-29  1:23         ` Ming Lei
2018-11-29  2:19         ` Jens Axboe
2018-11-29  2:19           ` Jens Axboe
2018-11-29  2:51           ` Ming Lei
2018-11-29  2:51             ` Ming Lei
2018-11-29  3:13             ` Jens Axboe
2018-11-29  3:13               ` Jens Axboe
2018-11-29  3:27               ` Ming Lei
2018-11-29  3:27                 ` Ming Lei
2018-11-29  3:53                 ` Jens Axboe
2018-11-29  3:53                   ` Jens Axboe
2018-11-28  7:21   ` Christoph Hellwig
2018-11-28  7:21     ` Christoph Hellwig
2018-11-26 16:35 ` [PATCH 6/8] ataflop: " Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-27 23:46   ` Omar Sandoval
2018-11-27 23:46     ` Omar Sandoval
2018-11-28  7:22   ` Christoph Hellwig
2018-11-28  7:22     ` Christoph Hellwig
2018-11-28 13:09     ` Jens Axboe
2018-11-28 13:09       ` Jens Axboe
2018-11-26 16:35 ` [PATCH 7/8] blk-mq: use bd->last == true for list inserts Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-27 23:49   ` Omar Sandoval
2018-11-27 23:49     ` Omar Sandoval
2018-11-27 23:51     ` Jens Axboe
2018-11-27 23:51       ` Jens Axboe
2018-11-28  1:49   ` Ming Lei
2018-11-28  1:49     ` Ming Lei
2018-11-28  2:37     ` Jens Axboe
2018-11-28  2:37       ` Jens Axboe
2018-11-26 16:35 ` [PATCH 8/8] blk-mq: add plug case for devices that implement ->commits_rqs() Jens Axboe
2018-11-26 16:35   ` Jens Axboe
2018-11-28  7:26   ` Christoph Hellwig
2018-11-28  7:26     ` Christoph Hellwig
2018-11-28 13:11     ` Jens Axboe
2018-11-28 13:11       ` Jens Axboe

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=20181128013852.GD11128@ming.t460p \
    --to=ming.lei@redhat.com \
    --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.