Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3713882imu; Mon, 28 Jan 2019 09:29:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Vb++Mx6OM1iRYHVdw/XK6anqV9KxWEYdge+rCoR6/sN8FGKRlkzlprKOVkesR4RdtS8nD X-Received: by 2002:a65:5c4b:: with SMTP id v11mr20525986pgr.333.1548696580843; Mon, 28 Jan 2019 09:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696580; cv=none; d=google.com; s=arc-20160816; b=LRsUWQTbxp6WS3j6q+1FTR6dwUIGouzg/BTKWjxZIBs+rp/gqQlxA9Zumbgy+i2BCX 9Xajjbx7GSCHHVDXheoH6kpMy/bZG6q/+LFRxnsRawZQ5CjM7Gi0VykXJ9VRy/mgJaMr wwxWrl5wRnsoMWQ+Ezc/7rGZi311XEDeXDbD0r30R9swzlXlWkFkZuJKshFxr0Eniy9h aPxw1qEtn+2rm48rsJgE12fbn/W8fOpC2ficzECFBmTWXreu+FnIsYVPxFqjxJXlsbNn pDwkOGLokyVgWZWKB+qGEvxzPOlYxOchnSGg3VmixXIiIHuejMKHpGRwHP8hzuHzblap nPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e7q1KvpswPBAc9hP56jvwWyBvgsxRU5vUi9aBtXUYzU=; b=EPP8YRvCjQ5yrqHxUEk6luKodujtw8FPaRCirRdoFbpzgL7JUWqe6mMyhVaIeA0qsa ZU223AFb4iOgW8gErm3POGQ1o0cvd2vS2kz9aQ5zhIirOfzM/OFlLq6vOoXKkqGbpz8a vNOM8C5qlOjPFlrYRc4R8Z+v4zNnygqyYLkVuI8cPn8BTgEhSOq1Whp9MReX80bae2fe sQo5JqszeOqOR+S3IFJ+W5qUnPI2amFPS7nW8icRVlXZG3kceUJtOfcj874aJ+C42gHx zPLItIJ0j51Gkup6mzgH+jtqApzvm8oYxJuQH3bLpS1ySkqgBVPT5LDqPjsQpXg/oaGf tyHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g86zUMSb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si2304880plz.53.2019.01.28.09.29.24; Mon, 28 Jan 2019 09:29:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=g86zUMSb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730764AbfA1R3U (ORCPT + 99 others); Mon, 28 Jan 2019 12:29:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:45116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730629AbfA1P7s (ORCPT ); Mon, 28 Jan 2019 10:59:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C5C821848; Mon, 28 Jan 2019 15:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691188; bh=pKKn77FAk7lTGPblNWGmJvw2sy1EhkiAlcakvIk0S2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g86zUMSbFAvzfNUZ9NbU3tYCd272ScGQ8tmKTwD5WyOL3i8sFaBa0GI7d1BC/WMob 9UHSTNRGvoZrNtl35Z8YWziYMKr9juJOP4FpZuCpHWSWcpyF4UIAC1FoyMlPxIfUBI cNwrXQX96IrX9aqVfvwdCE4mhjzY3VNVOSntjz+Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Long Li , Thomas Gleixner , Michael Kelley , Sasha Levin Subject: [PATCH AUTOSEL 4.19 008/258] genirq/affinity: Spread IRQs to all available NUMA nodes Date: Mon, 28 Jan 2019 10:55:14 -0500 Message-Id: <20190128155924.51521-8-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li [ Upstream commit b82592199032bf7c778f861b936287e37ebc9f62 ] If the number of NUMA nodes exceeds the number of MSI/MSI-X interrupts which are allocated for a device, the interrupt affinity spreading code fails to spread them across all nodes. The reason is, that the spreading code starts from node 0 and continues up to the number of interrupts requested for allocation. This leaves the nodes past the last interrupt unused. This results in interrupt concentration on the first nodes which violates the assumption of the block layer that all nodes are covered evenly. As a consequence the NUMA nodes above the number of interrupts are all assigned to hardware queue 0 and therefore NUMA node 0, which results in bad performance and has CPU hotplug implications, because queue 0 gets shut down when the last CPU of node 0 is offlined. Go over all NUMA nodes and assign them round-robin to all requested interrupts to solve this. [ tglx: Massaged changelog ] Signed-off-by: Long Li Signed-off-by: Thomas Gleixner Reviewed-by: Ming Lei Cc: Michael Kelley Link: https://lkml.kernel.org/r/20181102180248.13583-1-longli@linuxonhyperv.com Signed-off-by: Sasha Levin --- kernel/irq/affinity.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index f4f29b9d90ee..e12cdf637c71 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -117,12 +117,11 @@ static int irq_build_affinity_masks(const struct irq_affinity *affd, */ if (numvecs <= nodes) { for_each_node_mask(n, nodemsk) { - cpumask_copy(masks + curvec, node_to_cpumask[n]); - if (++done == numvecs) - break; + cpumask_or(masks + curvec, masks + curvec, node_to_cpumask[n]); if (++curvec == last_affv) curvec = affd->pre_vectors; } + done = numvecs; goto out; } -- 2.19.1