Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2663716imj; Mon, 11 Feb 2019 06:40:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IaRqcVJM2KOCwKCNox3RlWN7tl9ppI0expYxEYQvSHyxzXKpPDs+Ot7H3kB9pLbczeDyRMn X-Received: by 2002:a62:5301:: with SMTP id h1mr36684286pfb.17.1549896043369; Mon, 11 Feb 2019 06:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896043; cv=none; d=google.com; s=arc-20160816; b=hkj3GVtS/G3dO9yNTJBCtXJsfc74GzcJEV9thn1x/eF2HRQJz5E1DhT6XalmMRHViJ LBRe6li6lQDFh7Q0i6eMBRNRE67vzLkMdw+3lBUtMjdp1UQrP5yb95DycKus8/Jf2YEa iSSAxYyGq29Q1b0s4aSKe5ucpYLT4Aj3/PIgPAfSLnLTDqQv5rrAYRjB+pdYNFFdr0ES qAXV22TjxnSST/JXcHAtkWzjXcX4vXYT/I4tNGQlYUvEwuiBvlNM81pm25dUBJ9CgopU 1AJc2SrovjKLc/k1Acj7Wa4pinnRCr0KoH0OVF0Tgg9KuF1RN+FpkutR7IgjrAFjUc6c gMSw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u1Wr9JJQK34K3Y0hMCyOUIXZoYd8pAiLTyqjl2z+F8A=; b=ufqplVSwhmC7lProMDeOMfKPdMW9dIy84FTzxmQp+c01QtQhBIhuxC6qMk2nph1nx1 7fO8cgVQJeXQV+9l7Rq0NBtsKqhXf0euKdZIVhbmun2qpubCaNUI5g5obizId9B5aaR9 V+pBHvZwbhyBYemY74B6fsGNMaf62bj9FIHApLumguyMg+/NLvohvNKXBO1jX2cPQbhD uOLpOlfDr1vZ14N6zan+aZLjtsNC2lLkoXGk+m4NQgEy3BjArtvh2nM+H1+eNV6ZCuIE l3IB2dwktrm0V47otINULhGmMP4bTdLnOr0VOghhHfO1SUHS6czDf+PUMtCQEAOiy/ai m01g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MeCG1Dhi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b79si10619233pfe.273.2019.02.11.06.40.26; Mon, 11 Feb 2019 06:40:43 -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=MeCG1Dhi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731886AbfBKOj2 (ORCPT + 99 others); Mon, 11 Feb 2019 09:39:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:49710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728002AbfBKOj0 (ORCPT ); Mon, 11 Feb 2019 09:39:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5D1120700; Mon, 11 Feb 2019 14:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895965; bh=zOVSQ8PZ89S8cs0q2VNE6PyEw+f40T5yc4wbtIhbmuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MeCG1DhiekYMSUE5p/oLyOFDYaZqhJQJyNfdgkZ6SvBhlHcH6OJixoa+sRmjoyjoV pgT++Iwalo7jyqzJBDE+NL4FwmLSxcCl5B4AHKd0z/k8hGBlxhsfzsTU90YdB+Vixl oKphD0Nz2bJpeJrGT/bE0q5MgjMvRhAWefJTwisw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Thomas Gleixner , Ming Lei , Michael Kelley , Sasha Levin Subject: [PATCH 4.19 009/313] genirq/affinity: Spread IRQs to all available NUMA nodes Date: Mon, 11 Feb 2019 15:14:49 +0100 Message-Id: <20190211141853.580982643@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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