From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@fb.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, jbacik@fb.com
Subject: Re: [PATCH 1/2] blk-mq: get rid of manual run of queue with __blk_mq_run_hw_queue()
Date: Thu, 22 Sep 2016 11:56:03 -0700 [thread overview]
Message-ID: <20160922185603.GA32468@infradead.org> (raw)
In-Reply-To: <1474555980-2787-2-git-send-email-axboe@fb.com>
Ok, I looked into this a bit more, and while I'm still fine with the
patch I think it's only half of what we should do here. There really
is no point in doing the first non-blocking path in blk_mq_map_request
either as bt_get itself already does the non-blocking pass, and also
runs the queue when scheduling in the later loop as well. So to get
towards what I had in my tree we also need something like this:
---
>From c69bf02929d9c37d193b004a4c3c85c1142fa996 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Thu, 22 Sep 2016 11:38:23 -0700
Subject: blk-mq: remove non-blocking pass in blk_mq_map_request
bt_get already does a non-blocking pass as well as running the queue
when scheduling internally, no need to duplicate it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-mq.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index eae2f12..e9ebe98 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1210,20 +1210,8 @@ static struct request *blk_mq_map_request(struct request_queue *q,
op_flags |= REQ_SYNC;
trace_block_getrq(q, bio, op);
- blk_mq_set_alloc_data(&alloc_data, q, BLK_MQ_REQ_NOWAIT, ctx, hctx);
+ blk_mq_set_alloc_data(&alloc_data, q, 0, ctx, hctx);
rq = __blk_mq_alloc_request(&alloc_data, op, op_flags);
- if (unlikely(!rq)) {
- blk_mq_run_hw_queue(hctx, false);
- blk_mq_put_ctx(ctx);
- trace_block_sleeprq(q, bio, op);
-
- ctx = blk_mq_get_ctx(q);
- hctx = q->mq_ops->map_queue(q, ctx->cpu);
- blk_mq_set_alloc_data(&alloc_data, q, 0, ctx, hctx);
- rq = __blk_mq_alloc_request(&alloc_data, op, op_flags);
- ctx = alloc_data.ctx;
- hctx = alloc_data.hctx;
- }
hctx->queued++;
data->hctx = hctx;
--
2.1.4
next prev parent reply other threads:[~2016-09-22 18:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 14:52 [PATCH 0/2]: Add option for async ->queue_rq Jens Axboe
2016-09-22 14:52 ` [PATCH 1/2] blk-mq: get rid of manual run of queue with __blk_mq_run_hw_queue() Jens Axboe
2016-09-22 14:56 ` Christoph Hellwig
2016-09-22 18:56 ` Christoph Hellwig [this message]
2016-09-22 20:29 ` Jens Axboe
2016-09-23 21:59 ` Sagi Grimberg
2016-09-23 21:56 ` Sagi Grimberg
2016-09-22 14:53 ` [PATCH 2/2] blk-mq: add flag for drivers wanting blocking ->queue_rq() Jens Axboe
2016-09-22 14:59 ` Christoph Hellwig
2016-09-22 15:03 ` Jens Axboe
2016-09-22 15:12 ` Christoph Hellwig
2016-09-22 15:17 ` Jens Axboe
2016-09-23 1:43 ` Ming Lei
2016-09-23 2:44 ` Josef Bacik
2016-09-23 1:35 ` Ming Lei
2016-09-22 15:04 ` Josef Bacik
2016-09-22 18:01 ` [PATCH 0/2]: Add option for async ->queue_rq Josef Bacik
2016-09-28 0:25 ` Bart Van Assche
2016-09-28 16:43 ` Omar Sandoval
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=20160922185603.GA32468@infradead.org \
--to=hch@infradead.org \
--cc=axboe@fb.com \
--cc=axboe@kernel.dk \
--cc=jbacik@fb.com \
--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 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).