From patchwork Wed Jan 4 22:41:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9497971 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 7E94460237 for ; Wed, 4 Jan 2017 22:33:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AADB281E1 for ; Wed, 4 Jan 2017 22:33:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F4CA2832F; Wed, 4 Jan 2017 22:33:29 +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 EEA9B281E1 for ; Wed, 4 Jan 2017 22:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966029AbdADWd1 (ORCPT ); Wed, 4 Jan 2017 17:33:27 -0500 Received: from mga01.intel.com ([192.55.52.88]:56596 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968988AbdADWd0 (ORCPT ); Wed, 4 Jan 2017 17:33:26 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 04 Jan 2017 14:32:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,317,1477983600"; d="scan'208";a="50168421" 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 2/6] irq/affinity: Assign offline CPUs a vector Date: Wed, 4 Jan 2017 17:41:07 -0500 Message-Id: <1483569671-1462-3-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 offline CPUs need to assigned to something incase they come online later, otherwise anyone using the mapping for things other than affinity will have blank entries for that online CPU. Signed-off-by: Keith Busch --- kernel/irq/affinity.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index b25dce0..2367531 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -129,6 +129,14 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) } done: + /* + * Assign offline CPUs to first mask in case they come online later. A + * driver can rerun this from a cpu notifier if they want a more optimal + * spread. + */ + cpumask_andnot(nmsk, cpu_possible_mask, cpu_online_mask); + irq_spread_init_one(masks, nmsk, cpumask_weight(nmsk)); + put_online_cpus(); /* Fill out vectors at the end that don't need affinity */