Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6284124pxu; Wed, 23 Dec 2020 20:26:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUQvqYKAlna6cpZC/YV3O/FBEYmmFA2tMG9aAEuyPDDuGKiBBt/A/CvzRlKIKQkYkQ9sIL X-Received: by 2002:a17:906:3712:: with SMTP id d18mr27362404ejc.178.1608784018823; Wed, 23 Dec 2020 20:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608784018; cv=none; d=google.com; s=arc-20160816; b=KTa3jPpJQ+1/P4VtXGFnyf33xq4EhBWupIcN9L4v6FTFK5n/2V75DNXxL0tVK4MevX NSBb/OSpf/R8k7cwubsALf3mD0JUGrZNbdNWesS9Oh71OccueGWT3DIEBSjHKjGv1ldW y57G3OBLxX1gQTPxa+xp+XNNmcbQ2e49nEEUYel+QTn197wAM6xzj68+xk66GbcpBDVX DqtZX7VpwA8W0RlTCHe4b2YM8Swr7WPC627BKbHKg6nsuiuTlFGOnZE7KVwVqREUCARu O/K8SpAsh8tOHOUlCQ5k8Zxk11nu3Ph40wFjFOg5o0k1tSQazTTvj/ThzQOisuCmOA4a POmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=opATvf1s9ywv6Q/5hNrA6Pvak3JhPCOaq9odt6OVW1c=; b=eUZd828Il8ZGryvsQBfzRbYUxgKN4GpIvgqLNDGLDWEVXQAcOmYKpF6mCSs/ntiyyX ObEKb4tRDSDkupZTjbtl2R6rrY4IutbYg4yDplq+ImV0g8cJeTnd45dpj+erGBUOAscE uiHQEIy2UD2b1R6N7mocW36QeEB4yCM5O6eTRJqEeG/qS6lOsLF5CeymMZlcNRk5arsd 5jOXENf0anqT0mqyNglwiq/5lXPVL0xVs4j+4Q5i8w96MbPD8ojcTKGSMLbUTS+NH5bE MH5DsmjUo6A8gFIIs7VV7U2a+THTFsWqzBHfmkQKw4TbZnrS6D305J0MMHO8R0mBxBwe bKaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si14104422edo.600.2020.12.23.20.26.21; Wed, 23 Dec 2020 20:26:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbgLXEYh (ORCPT + 99 others); Wed, 23 Dec 2020 23:24:37 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10075 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbgLXEYh (ORCPT ); Wed, 23 Dec 2020 23:24:37 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D1cPZ32qHzM8bb for ; Thu, 24 Dec 2020 12:22:58 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 24 Dec 2020 12:23:46 +0800 From: Liu Chao To: , CC: , Subject: [PATCH] genirq: Limit irq_calc_affinity_vectors to housekeeping CPUs Date: Thu, 24 Dec 2020 12:23:13 +0800 Message-ID: <20201224042313.733960-1-liuchao173@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the cpumask used in irq_calc_affinity_vectors from all possible CPUs to only housekeeping CPUs. When we have isolated CPUs used by real-time tasks, IRQs will be move to housekeeping CPUs. If there are too many IRQ vectors, moving the all to housekeeping CPUs may exceed per-CPU vector limits. For example, when I only have two housekeeping CPUs, there are dozens of IRQs on two CPUs, but actually one IRQ per housekeeping CPU is enough. Signed-off-by: Liu Chao --- kernel/irq/affinity.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 4d89ad4fae3b..3f22e3314e1b 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -8,6 +8,7 @@ #include #include #include +#include static void irq_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk, unsigned int cpus_per_vec) @@ -506,7 +507,8 @@ unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec, set_vecs = maxvec - resv; } else { get_online_cpus(); - set_vecs = cpumask_weight(cpu_possible_mask); + set_vecs = cpumask_weight( + housekeeping_cpumask(HK_FLAG_MANAGED_IRQ)); put_online_cpus(); } -- 2.23.0