Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2772061imj; Mon, 11 Feb 2019 08:13:57 -0800 (PST) X-Google-Smtp-Source: AHgI3IbxQg60pQd7WDn/ueORy3aswbBMI7RX0lCkJcUC2OmaAXiAgT4oJcKA9K6PNRLaevdWHf/A X-Received: by 2002:a63:f816:: with SMTP id n22mr20868804pgh.146.1549901637503; Mon, 11 Feb 2019 08:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901637; cv=none; d=google.com; s=arc-20160816; b=VzwfSfr2BjMJQ3591NGkSz4BJp2cxMTY3zFDjvq735/St0Mot/QXY1xj24jczQsX/U 4qEPgDKqI0DxE5ZkZD0P3IZN/u4WwlPSNKwgP1zYp0OPCTZ1oZUyP39MKKW9F6rhqSCP J6u5VTAfKj9XYlwF4HManwQsyDY5FnYxVgc/ygYyvb3dNeMkj9uNAabeWO+OQSNsdm4Q enlfxGV84JgZ5CavRD3hTAMae497H9WHLlPXRcCSe/k/v5lpouVtAXujTI2zvcmKR953 ka3Te3iLmBvcWRQpdN+D4xqudIL8DZjHkAmXmDovlRT1sxoz7+d/2j25ctBpgz7kBvcv +Tlw== 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=kLj0/wnJqKTS13BC+MBWY0DmxHICv9jNY0LjYlaW8Js=; b=VWsNIY9rWqfUxbZGpwST+dB8OvcHYL/JivEswMMI7OpGrORsSL5MyGQXLPXaCiL5jN 9mwwx0da2wbA82g8Os/Su00Zi2vx/tLV9d+hjbDcjvO6Eqt76rEP3poJctTcPoonsUxp Pmrh0agjBqtf5OaWtr5vpMRtA4Iw562WsjPf9DGKU/Bp4obxCNipa/Rq+HE8TRKbQQ5Y PFiwAW2uapubsZgrGiXJHbF4YxiYiW7aXz/Ok2U+Clk0MhS+oHipoHIsJNXX/g3ZL18C mIQboZrAP/v1fO8mRaekO1knhRjF9e9mNGYYrnaEe0te13lHb1fudP3JX7ogXxNaLHWk TyQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cT+5CwS3; 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 b12si10223016pls.32.2019.02.11.08.13.41; Mon, 11 Feb 2019 08:13:57 -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=cT+5CwS3; 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 S1728896AbfBKOW7 (ORCPT + 99 others); Mon, 11 Feb 2019 09:22:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:55964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbfBKOW6 (ORCPT ); Mon, 11 Feb 2019 09:22:58 -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 CBFCA222A1; Mon, 11 Feb 2019 14:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549894977; bh=dKUb8vulXQNpdtjNLMg/62jy00nkV0znlLLcL2wfow0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cT+5CwS3ar2cfRt/m/Pg+9pU58zswtIjuy7VfNKmUQgeHqJUMcF+DvowKh9Otr4dA iQ+5nAOY5vsHErckVtADIJodfruYF1LLRVzU6WNOJ++gudtQ6mycCp580hu0sW7qqL 1WqDmD/3AIrOOc0FQmWPBWPBxWiHv/RvKIfsGdZ8= 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.20 011/352] genirq/affinity: Spread IRQs to all available NUMA nodes Date: Mon, 11 Feb 2019 15:13:58 +0100 Message-Id: <20190211141847.139076298@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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