From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "hch@infradead.org" <hch@infradead.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>,
"sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH 3/6] blk-mq: send the request to dispatch list if direct issue returns busy
Date: Wed, 12 Jul 2017 11:45:38 +0800 [thread overview]
Message-ID: <20170712034538.GJ13036@ming.t460p> (raw)
In-Reply-To: <1499804330.2586.32.camel@wdc.com>
On Tue, Jul 11, 2017 at 08:18:51PM +0000, Bart Van Assche wrote:
> On Wed, 2017-07-12 at 02:21 +0800, Ming Lei wrote:
> > Before mq IO scheduler is in, we always send the request to
> > dispatch list if .queue_rq() return busy. After mq IO scheduler
> > is introduced, we only do this way when scheduler is used in
> > case of direct issue. Actually we can do that when scheduler
> > isn't used too.
> >
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> > ---
> > block/blk-mq.c | 18 +++++++++++++++---
> > 1 file changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index 041f7b7fa0d6..6e0fc80aa151 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -1463,6 +1463,16 @@ static blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx, struct request *rq)
> > return blk_tag_to_qc_t(rq->internal_tag, hctx->queue_num, true);
> > }
> >
> > +static void blk_mq_direct_dispatch(struct blk_mq_hw_ctx *hctx,
> > + struct request *rq)
> > +{
> > + spin_lock(&hctx->lock);
> > + list_add(&rq->queuelist, &hctx->dispatch);
> > + spin_unlock(&hctx->lock);
> > +
> > + blk_mq_run_hw_queue(hctx, false);
> > +}
> > +
> > static void __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
> > struct request *rq,
> > blk_qc_t *cookie, bool may_sleep)
> > @@ -1499,15 +1509,17 @@ static void __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
> > switch (ret) {
> > case BLK_STS_OK:
> > *cookie = new_cookie;
> > - return;
> > + break;
> > case BLK_STS_RESOURCE:
> > __blk_mq_requeue_request(rq);
> > - goto insert;
> > + blk_mq_direct_dispatch(hctx, rq);
> > + break;
> > default:
> > *cookie = BLK_QC_T_NONE;
> > blk_mq_end_request(rq, ret);
> > - return;
> > + break;
> > }
> > + return;
> >
> > insert:
> > blk_mq_sched_insert_request(rq, false, run_queue, false, may_sleep);
>
> Hello Ming,
>
> This patch changes the behavior of blk_mq_try_issue_directly() if a scheduler
> has been configured and .queue_rq() returns BLK_STS_RESOURCE, namely by skipping
> the e->type->ops.mq.insert_requests() call. Sorry but I don't think this is what
> we want.
It does not change behaviour for scheduler, please see
blk_mq_sched_bypass_insert() which is called from
blk_mq_sched_insert_request().
--
Ming
next prev parent reply other threads:[~2017-07-12 3:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 18:20 [PATCH 0/6] blk-mq: introduce congestion control Ming Lei
2017-07-11 18:20 ` [PATCH 1/6] xen-blkfront: avoid to use start/stop queue Ming Lei
2017-07-11 18:41 ` Konrad Rzeszutek Wilk
2017-07-12 2:52 ` Ming Lei
2017-07-11 18:41 ` Bart Van Assche
2017-07-12 2:59 ` Ming Lei
2017-07-12 3:05 ` Ming Lei
2017-07-11 21:24 ` Roger Pau Monné
2017-07-12 3:12 ` Ming Lei
2017-07-11 18:20 ` [PATCH 2/6] SCSI: use blk_mq_run_hw_queues() in scsi_kick_queue() Ming Lei
2017-07-11 19:57 ` Bart Van Assche
2017-07-12 3:15 ` Ming Lei
2017-07-12 15:12 ` Bart Van Assche
2017-07-13 10:23 ` Ming Lei
2017-07-13 17:44 ` Bart Van Assche
2017-07-11 18:21 ` [PATCH 3/6] blk-mq: send the request to dispatch list if direct issue returns busy Ming Lei
2017-07-11 20:18 ` Bart Van Assche
2017-07-12 3:45 ` Ming Lei [this message]
2017-07-11 18:21 ` [PATCH 4/6] blk-mq: use EWMA to estimate congestion threshold Ming Lei
2017-07-11 18:25 ` Jens Axboe
2017-07-12 2:30 ` Ming Lei
2017-07-12 15:39 ` Bart Van Assche
2017-07-13 10:43 ` Ming Lei
2017-07-13 14:56 ` Bart Van Assche
2017-07-13 15:32 ` Ming Lei
2017-07-13 17:35 ` Bart Van Assche
2017-07-11 18:39 ` Jens Axboe
2017-07-12 3:20 ` Ming Lei
2017-07-11 21:02 ` Bart Van Assche
2017-07-12 3:43 ` Ming Lei
2017-07-11 18:21 ` [PATCH 5/6] blk-mq: introduce basic congestion control Ming Lei
2017-07-11 18:21 ` [PATCH 6/6] blk-mq: unexport APIs for start/stop queues 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=20170712034538.GJ13036@ming.t460p \
--to=ming.lei@redhat.com \
--cc=Bart.VanAssche@wdc.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=sagi@grimberg.me \
/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