From patchwork Mon Aug 21 13:49:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 804027 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xbZrR5tFWz9s78 for ; Mon, 21 Aug 2017 23:52:39 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xbZrR4rFPzDrKb for ; Mon, 21 Aug 2017 23:52:39 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xbZnL5VYMzDqZ7 for ; Mon, 21 Aug 2017 23:49:58 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 083FC7F7D0; Mon, 21 Aug 2017 13:49:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 083FC7F7D0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lvivier@redhat.com Received: from thinkpad.redhat.com (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E5D3702E8; Mon, 21 Aug 2017 13:49:55 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] blk-mq: don't use WORK_CPU_UNBOUND Date: Mon, 21 Aug 2017 15:49:51 +0200 Message-Id: <20170821134951.18848-2-lvivier@redhat.com> In-Reply-To: <20170821134951.18848-1-lvivier@redhat.com> References: <20170821134951.18848-1-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 21 Aug 2017 13:49:57 +0000 (UTC) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , Lai Jiangshan , linux-block@vger.kernel.org, Tejun Heo , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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;