From patchwork Wed Jan 4 22:41:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9497977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B47C860237 for ; Wed, 4 Jan 2017 22:33:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9246D2811C for ; Wed, 4 Jan 2017 22:33:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8303A2832F; Wed, 4 Jan 2017 22:33:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 060992811C for ; Wed, 4 Jan 2017 22:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969019AbdADWd3 (ORCPT ); Wed, 4 Jan 2017 17:33:29 -0500 Received: from mga01.intel.com ([192.55.52.88]:17130 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968999AbdADWd1 (ORCPT ); Wed, 4 Jan 2017 17:33:27 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 04 Jan 2017 14:32:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,317,1477983600"; d="scan'208";a="50168429" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.96]) by fmsmga006.fm.intel.com with ESMTP; 04 Jan 2017 14:32:56 -0800 From: Keith Busch To: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Jens Axboe , Jens Axboe , Christoph Hellwig , Thomas Gleixner Cc: Marc Merlin , Keith Busch Subject: [PATCH 4/6] blk-mq: Update queue map when changing queue count Date: Wed, 4 Jan 2017 17:41:09 -0500 Message-Id: <1483569671-1462-5-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1483569671-1462-1-git-send-email-keith.busch@intel.com> References: <1483569671-1462-1-git-send-email-keith.busch@intel.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The queue map needs to match how many hardware queues exist, otherwise it may indicate a less than optimal mapping, contain a hctx_id that was freed, or attempt to initialize a request map for invalid context. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- block/blk-mq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index a8e67a1..9b7ed03 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2223,7 +2223,6 @@ static void blk_mq_queue_reinit(struct request_queue *q, * we should change hctx numa_node according to new topology (this * involves free and re-allocate memory, worthy doing?) */ - blk_mq_map_swqueue(q, online_mask); blk_mq_sysfs_register(q); @@ -2481,6 +2480,11 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues) blk_mq_freeze_queue(q); set->nr_hw_queues = nr_hw_queues; + if (set->ops->map_queues) + set->ops->map_queues(set); + else + blk_mq_map_queues(set); + list_for_each_entry(q, &set->tag_list, tag_set_list) { blk_mq_realloc_hw_ctxs(set, q);