From: Ming Lei <tom.leiming@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Cc: Ming Lei <tom.leiming@gmail.com>
Subject: [PATCH] blk-mq: run hw queue asynchronously in blk_mq_start_hw_queues
Date: Tue, 24 Jun 2014 22:53:08 +0800 [thread overview]
Message-ID: <1403621588-25109-1-git-send-email-tom.leiming@gmail.com> (raw)
>From API view, it isn't good to run all hw queues synchronously
in one context, since it isn't correct for multi hw queue case.
So this patch adds 'async' parameter to blk_mq_start_hw_queue(),
and make blk_mq_start_hw_queues() to run hw queues asynchronously
at default.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
block/blk-mq.c | 6 +++---
include/linux/blk-mq.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 0ef2dc7..f83eacd 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -873,12 +873,12 @@ void blk_mq_stop_hw_queues(struct request_queue *q)
}
EXPORT_SYMBOL(blk_mq_stop_hw_queues);
-void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx)
+void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
{
clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
preempt_disable();
- __blk_mq_run_hw_queue(hctx);
+ blk_mq_run_hw_queue(hctx, async);
preempt_enable();
}
EXPORT_SYMBOL(blk_mq_start_hw_queue);
@@ -889,7 +889,7 @@ void blk_mq_start_hw_queues(struct request_queue *q)
int i;
queue_for_each_hw_ctx(q, hctx, i)
- blk_mq_start_hw_queue(hctx);
+ blk_mq_start_hw_queue(hctx, true);
}
EXPORT_SYMBOL(blk_mq_start_hw_queues);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index eb726b9..49e84b5 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -169,7 +169,7 @@ void blk_mq_kick_requeue_list(struct request_queue *q);
void blk_mq_complete_request(struct request *rq);
void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
-void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
+void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
void blk_mq_stop_hw_queues(struct request_queue *q);
void blk_mq_start_hw_queues(struct request_queue *q);
void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
--
1.7.9.5
next reply other threads:[~2014-06-24 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 14:53 Ming Lei [this message]
2014-06-25 2:42 ` Ming Lei
2014-06-25 3:00 ` Jens Axboe
2014-06-25 4:47 ` 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=1403621588-25109-1-git-send-email-tom.leiming@gmail.com \
--to=tom.leiming@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®