linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>,
	linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND
Date: Mon, 21 Aug 2017 15:49:51 +0200	[thread overview]
Message-ID: <20170821134951.18848-2-lvivier@redhat.com> (raw)
In-Reply-To: <20170821134951.18848-1-lvivier@redhat.com>

cpumask is the list of CPUs present when the queue is built.
If a new CPU is hotplugged, this list is not updated,
and when the scheduler asks for a CPU id, blk_mq_hctx_next_cpu()
can return WORK_CPU_UNBOUND.
And in this case _blk_mq_run_hw_queue() can be executed by the new CPU
(that is not present in cpumask) and raises the following warning:

    WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
            cpu_online(hctx->next_cpu));

To fix this problem, this patch modifies blk_mq_hctx_next_cpu()
to only return a CPU id present in cpumask.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 block/blk-mq.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4603b115e234..bdac1e654814 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1126,9 +1126,6 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
  */
 static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
 {
-	if (hctx->queue->nr_hw_queues == 1)
-		return WORK_CPU_UNBOUND;
-
 	if (--hctx->next_cpu_batch <= 0) {
 		int next_cpu;
 
-- 
2.13.5

  reply	other threads:[~2017-08-21 13:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 13:49 [PATCH 1/2] powerpc/workqueue: update list of possible CPUs Laurent Vivier
2017-08-21 13:49 ` Laurent Vivier [this message]
2017-08-21 14:48   ` [PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND Tejun Heo
2017-08-21 14:48 ` [PATCH 1/2] powerpc/workqueue: update list of possible CPUs Tejun Heo
2017-08-22  1:41   ` Michael Ellerman
2017-08-22 16:54     ` Tejun Heo
2017-08-23 11:00       ` Michael Ellerman
2017-08-23 11:17         ` Laurent Vivier
2017-08-23 13:26         ` Tejun Heo
2017-08-24 12:10           ` Laurent Vivier
2017-08-24 13:51             ` Tejun Heo

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=20170821134951.18848-2-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=tj@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).