All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <tom.leiming@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] blk-mq: run hw queue asynchronously in blk_mq_start_hw_queues
Date: Tue, 24 Jun 2014 21:00:59 -0600	[thread overview]
Message-ID: <53AA3B6B.1040103@kernel.dk> (raw)
In-Reply-To: <CACVXFVMWDBEhRhKQ1V2O9sWbAdQNb_RM0Nz_BA7Cn7P_OrvndQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

On 2014-06-24 20:42, Ming Lei wrote:
> On Tue, Jun 24, 2014 at 10:53 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>>  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.
>
> BTW, without the change, it is easy to trigger the WARN_ON() in
> __blk_mq_run_hw_queue().

Why not just have it call blk_mq_run_hw_queue()? Pass in async == false, 
but let the cpumask logic sort out if we need to force an async run.

-- 
Jens Axboe


[-- Attachment #2: start.patch --]
[-- Type: text/x-patch, Size: 399 bytes --]

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 0ef2dc7f01bf..ad69ef657e85 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -878,7 +878,7 @@ void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx)
 	clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
 
 	preempt_disable();
-	__blk_mq_run_hw_queue(hctx);
+	blk_mq_run_hw_queue(hctx, false);
 	preempt_enable();
 }
 EXPORT_SYMBOL(blk_mq_start_hw_queue);

  reply	other threads:[~2014-06-25  3:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 14:53 [PATCH] blk-mq: run hw queue asynchronously in blk_mq_start_hw_queues Ming Lei
2014-06-25  2:42 ` Ming Lei
2014-06-25  3:00   ` Jens Axboe [this message]
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=53AA3B6B.1040103@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    /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.