All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@fb.com>
Cc: linux-block@vger.kernel.org, hch@lst.de
Subject: Re: [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests
Date: Fri, 28 Apr 2017 12:04:58 +0800	[thread overview]
Message-ID: <20170428040457.GE31518@ming.t460p> (raw)
In-Reply-To: <1493333494-600-5-git-send-email-axboe@fb.com>

On Thu, Apr 27, 2017 at 04:51:32PM -0600, Jens Axboe wrote:
> Instead of bypassing the scheduler for insertion of reserved requests,
> we ensure that the request is marked as RQF_RESERVED so they driver
> knows where it came from.
> 
> Usually we just use the tag to know if it's reserved or not,
> but that only works when the request has a driver tag assigned.
> Using RQF_RESERVED can be done independently of whether or not
> scheduling is used.
> 
> Signed-off-by: Jens Axboe <axboe@fb.com>
> ---
>  block/blk-mq-sched.c   | 8 +++-----
>  block/blk-mq.c         | 3 +++
>  include/linux/blkdev.h | 2 ++
>  3 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
> index 8b361e192e8a..27c67465f856 100644
> --- a/block/blk-mq-sched.c
> +++ b/block/blk-mq-sched.c
> @@ -82,11 +82,7 @@ struct request *blk_mq_sched_get_request(struct request_queue *q,
>  	if (likely(!data->hctx))
>  		data->hctx = blk_mq_map_queue(q, data->ctx->cpu);
>  
> -	/*
> -	 * For a reserved tag, allocate a normal request since we might
> -	 * have driver dependencies on the value of the internal tag.
> -	 */
> -	if (e && !(data->flags & BLK_MQ_REQ_RESERVED)) {
> +	if (e) {
>  		data->flags |= BLK_MQ_REQ_INTERNAL;
>  
>  		/*
> @@ -104,6 +100,8 @@ struct request *blk_mq_sched_get_request(struct request_queue *q,
>  	}
>  
>  	if (rq) {
> +		if (data->flags & BLK_MQ_REQ_RESERVED)
> +			rq->rq_flags |= RQF_RESERVED;

I think this flag may not be needed, becasue driver can
decide if one rq is from reversed pool just by the tag, for example
of mtip32xx, it can be done easily by checking if rq->tag is zero.

So I suggest to not introduce this flag until it is necessary.

Thanks,
Ming

  reply	other threads:[~2017-04-28  4:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 22:51 [PATCH 0/6] Fixup mtip32xx for scheduling Jens Axboe
2017-04-27 22:51 ` [PATCH 1/6] mtip32xx: get rid of 'atomic' argument to mtip_exec_internal_command() Jens Axboe
2017-04-27 23:19   ` Bart Van Assche
2017-04-27 22:51 ` [PATCH 2/6] mtip32xx: kill atomic argument to mtip_quiesce_io() Jens Axboe
2017-04-27 23:20   ` Bart Van Assche
2017-04-27 22:51 ` [PATCH 3/6] mtip32xx: abstract out "are any commands active" helper Jens Axboe
2017-04-27 23:21   ` Bart Van Assche
2017-04-27 22:51 ` [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests Jens Axboe
2017-04-28  4:04   ` Ming Lei [this message]
2017-04-28  4:13     ` Jens Axboe
2017-04-27 22:51 ` [PATCH 5/6] mtip32xx: convert internal command issue to block IO path Jens Axboe
2017-04-27 23:29   ` Bart Van Assche
2017-04-27 23:35     ` Jens Axboe
2017-04-27 22:51 ` [PATCH 6/6] Revert "mtip32xx: pass BLK_MQ_F_NO_SCHED" Jens Axboe
2017-04-28  4:06   ` Ming Lei
2017-04-27 23:12 ` [PATCH 0/6] Fixup mtip32xx for scheduling Jens Axboe
2017-04-28 14:01 [PATCH v2 " Jens Axboe
2017-04-28 14:01 ` [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests Jens Axboe
2017-04-28 14:31 [PATCH v2a 0/6]: Fixup mtip32xx for scheduling Jens Axboe
2017-04-28 14:31 ` [PATCH 4/6] blk-mq: don't bypass scheduler for reserved requests Jens Axboe
2017-04-28 14:41   ` Christoph Hellwig
2017-04-28 14:45     ` 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=20170428040457.GE31518@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.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.