Received: by 10.223.176.5 with SMTP id f5csp596648wra; Tue, 6 Feb 2018 04:20:59 -0800 (PST) X-Google-Smtp-Source: AH8x225C/FY2i5UUwk38T3eVnHDiPeWUNyd5bKvXi3vOrTG3yn7W6aXZL//5Qtsg4cZdLpa4OKkI X-Received: by 2002:a17:902:12f:: with SMTP id 44-v6mr2241133plb.403.1517919659402; Tue, 06 Feb 2018 04:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517919659; cv=none; d=google.com; s=arc-20160816; b=w47i5iF1qUFMj62bsRmiGQiwdU7G8eKOOxgXXfHpFwy8cmNemfo5OYuKMmiAH81azP sGUrPUxHB5lFTGuIt64svKz3KIqg2h79HIzI53dKRwk6zntcW8PutEaclG7XyXumkJVF pZ6p+ErOZHHNMag6UGuoeA6XbPGzq6L7VTd/ETt4GBzsJV3U1NEEL/BSlVpiPx2vUNZp raRZ5937mHYsPoP7BLYJIuIEc+cd5GzdFW1Rqm4UBP/3Qj839ATEY6s0tI51Y0okuDyC is2cH3W0baXKNXTfd2rItBsAn6QSBkyUH65x6nIJDw20A3C6jha1jGZBkEvY90OWsTIn i8lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9uIwv9O2duN+y0EvrkeT4ZxRRtTzgsvfZuwbzqX/z8A=; b=Vdh0zVmbJ7nYo//cN7osC4WqOA1PEOLR/uozI54+PXhao1p1gA32C+1s6TbrgO/9Gk zNKlnfoUck5H4NnOCPr+y88HE4LxAREzGXC84Eu5awxnqwp5fX8fa3ZhSQ37P6Y21SR3 eTLS8bFjujGAMi6ZuqHtul6bx9+v27KbUwc98NrqBc0RqLKQfxNpwP2s9fv30SXtzmmc oEE4Fo/hoe2ft/sjGXGkPrl+BFmg8PsgTF9+MuklBiylWRCOTzsQp5d/TsZTaN3DetRl MvGN5oPTGni3ACH2lyT/STOGpqKCzhW+SxxvEJAaPQVbtT+muJocOjZIMEne2oJNilb6 XoMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si1516093pfd.236.2018.02.06.04.20.45; Tue, 06 Feb 2018 04:20:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752324AbeBFMTr (ORCPT + 99 others); Tue, 6 Feb 2018 07:19:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45752 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbeBFMTc (ORCPT ); Tue, 6 Feb 2018 07:19:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0528A3AD80; Tue, 6 Feb 2018 12:19:32 +0000 (UTC) Received: from localhost (ovpn-12-136.pek2.redhat.com [10.72.12.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE9B960C4A; Tue, 6 Feb 2018 12:19:19 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Laurence Oberman , Ming Lei , Keith Busch , Sagi Grimberg , Christoph Hellwig Subject: [PATCH 5/5] nvme: pci: pass max vectors as num_possible_cpus() to pci_alloc_irq_vectors Date: Tue, 6 Feb 2018 20:17:42 +0800 Message-Id: <20180206121742.29336-6-ming.lei@redhat.com> In-Reply-To: <20180206121742.29336-1-ming.lei@redhat.com> References: <20180206121742.29336-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 06 Feb 2018 12:19:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 84676c1f21 ("genirq/affinity: assign vectors to all possible CPUs") has switched to do irq vectors spread among all possible CPUs, so pass num_possible_cpus() as max vecotrs to be assigned. For example, in a 8 cores system, 0~3 online, 4~8 offline/not present, see 'lscpu': [ming@box]$lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 2 NUMA node(s): 2 ... NUMA node0 CPU(s): 0-3 NUMA node1 CPU(s): ... 1) before this patch, follows the allocated vectors and their affinity: irq 47, cpu list 0,4 irq 48, cpu list 1,6 irq 49, cpu list 2,5 irq 50, cpu list 3,7 2) after this patch, follows the allocated vectors and their affinity: irq 43, cpu list 0 irq 44, cpu list 1 irq 45, cpu list 2 irq 46, cpu list 3 irq 47, cpu list 4 irq 48, cpu list 6 irq 49, cpu list 5 irq 50, cpu list 7 Cc: Keith Busch Cc: Sagi Grimberg Cc: Thomas Gleixner Cc: Christoph Hellwig Signed-off-by: Ming Lei --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6fe7af00a1f4..f778426c93d5 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1903,7 +1903,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) int result, nr_io_queues; unsigned long size; - nr_io_queues = num_present_cpus(); + nr_io_queues = num_possible_cpus(); result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues); if (result < 0) return result; -- 2.9.5