From nobody Tue Feb 10 05:43:57 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6797B149DE3 for ; Wed, 3 Apr 2024 15:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156792; cv=none; b=Gq/cix349ETa+DDdUG96/VzGsU9+FWjCBpV2uMhKa5ezJvV8rqx2t0pd5NZxAfHFgchRUQc9B//A6vYm9ODCW5QLgz/g5v+7sbzRT6WDubV7Bh4Sk1CuOfv6I04APL6XTyPaorh95tmY3LfXTCZluUz9LwQfCed+a/i6Jc6LkqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156792; c=relaxed/simple; bh=54N//QKAL73VOVwcfjNuqoX3Jag5no7obFOKhG6hRyI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ol19/pK/hhYXctx/r1lfxPor/zpIJhOXWGqdc+MCUTFZbQRJmaW5pnaImHxSMkkQ4jE7hNJ8DeMANTVkmaawQ9SVuJzF2pCfuyIoQfrYEgz41t1xxsTED5qMRolNHYAieI8RbaGUIe+4HXhGFpzJ6r2p9ECeoPJT+1ohPwHn8RY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E2D7E1684; Wed, 3 Apr 2024 08:07:01 -0700 (PDT) Received: from e126645.arm.com (unknown [10.57.74.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A7F1D3F7B4; Wed, 3 Apr 2024 08:06:26 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Aaron Lu , Rui Zhang , Pierre Gondois , Anna-Maria Behnsen , Frederic Weisbecker , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Andrew Morton , Michal Hocko , Waiman Long Subject: [PATCH 3/7] sched/isolation: Use HKR_TYPE_SCHED in find_new_ilb() Date: Wed, 3 Apr 2024 17:05:35 +0200 Message-Id: <20240403150543.2793354-4-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240403150543.2793354-1-pierre.gondois@arm.com> References: <20240403150543.2793354-1-pierre.gondois@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace the HK_TYPE_MISC isolation mask with HKR_TYPE_SCHED in find_new_ilb(). This ultimately resolves [1], i.e. selecting a CPU for the nohz idle balance which cannot pull tasks through: sched_balance_trigger() \-nohz_balancer_kick() \-kick_ilb() \-find_new_ilb() \-smp_call_function_single_async() \-nohz_csd_cpu() \-raise_softirq_irqoff() sched_balance_softirq() \-_nohz_idle_balance() \-sched_balance_domains() Indeed, a following patch will add/remove CPUs with a NULL sched domain to the HKR_TYPE_SCHED cpumask. [1] https://lore.kernel.org/all/20230804090858.7605-1-rui.zhang@intel.com/ Reported-by: Zhang Rui Signed-off-by: Pierre Gondois --- kernel/sched/fair.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e3d707243ca7..0665f5eb4703 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11842,16 +11842,13 @@ static inline int on_null_domain(struct rq *rq) * - When one of the busy CPUs notices that there may be an idle rebalanci= ng * needed, they will kick the idle load balancer, which then does idle * load balancing for all the idle CPUs. - * - * - HK_TYPE_MISC CPUs are used for this task, because HK_TYPE_SCHED is no= t set - * anywhere yet. */ static inline int find_new_ilb(void) { const struct cpumask *hk_mask; int ilb_cpu; =20 - hk_mask =3D housekeeping_cpumask(HK_TYPE_MISC); + hk_mask =3D housekeeping_runtime_cpumask(HKR_TYPE_SCHED); =20 for_each_cpu_and(ilb_cpu, nohz.idle_cpus_mask, hk_mask) { =20 --=20 2.25.1