Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2768136lqz; Wed, 3 Apr 2024 08:07:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjJkrlKnjmjHwgtio3guviJIgx+1oZA1e2CQ0bcKtI/OR1Pffr0kwRP1hloMdZuYvYFuVgzxxxa8wdzqv6Gu5E2yraohWy38jbdTicHA== X-Google-Smtp-Source: AGHT+IHtQQqnocOd51shoNaZ/qMaORHSEUohJQsFGWYSZKFSrWZFmCf0ddkmbXimz2b03hSGlqGT X-Received: by 2002:a05:6402:518f:b0:566:ca0:4a91 with SMTP id q15-20020a056402518f00b005660ca04a91mr12958608edd.2.1712156824427; Wed, 03 Apr 2024 08:07:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712156824; cv=pass; d=google.com; s=arc-20160816; b=jVrlfvukfJNKURrez+OXda3JvVqp1M7y7iUYHaynlGhwrnwOUHwE8mmRnklhMrMqCV cqrMlwnH3vJTinp6DoTRDm0wtwTBohdUSjAlrcHISPiucvNS2U1YsricUJb2Nzqoun87 vnSSSZrOZwDhtQbhH8SyhF04ZqKJctsqRVwPkg12KSJM/AV0KApNjkek0yE0mTrzOxnz ABppHCpTbQBPoK59DUQvENGFGp+DrgEgnimGTfI/Ps40uxkEpkUH8AodN6/z8y3Yejz8 weov8YXsc6X5KwoftubNlPozSD94RT1IZ8izgi741ayEO/8yfTrSkDq0XSgrfwYOEnVK qV7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=8haNHVSvF6WyncU2y04ueZFEHyjClTrQCBBTZfpl3sk=; fh=uh7v3TFLkRdclUaJ31iRQUF0SFJkCo1r6j4YWAiFYYY=; b=XHCRhrMR+0FwY/kw1NALB+ZZ32+aLDddoBzBeQkMdhwO6gf+5mHJT2m7dVzTDFv8va i0k54Patji9ZW582rbqZ35qMEWsv11wyLjkucmQYv1g409lXgd3bM7Sf9kVbMc3HO7FX DnbhqIUH8+AKzWYRfRD3UJ8Vf+/YhS0ZPas4G03sgIBtCf5VtVTFiTqH7Ab4WMbwUPDn /eQG66IDQq9fjdLg9Sz0STnHkQPfQIRiZowjVU+kbgeJbYmSAfXSmdppcIhGnQQNhOy1 36gfPduu/J1a6aVE+memQoCURPuQiZaPMyMGVNSc6j6wJlQGeQYNt+KRbhRMf1TJUnHm cwnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-130034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u22-20020a50a416000000b0056dfa6c310esi1190860edb.243.2024.04.03.08.07.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-130034-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 282541F2490D for ; Wed, 3 Apr 2024 15:07:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FD4014A098; Wed, 3 Apr 2024 15:06:33 +0000 (UTC) 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: 8bit 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 rebalancing * 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 not set - * anywhere yet. */ static inline int find_new_ilb(void) { const struct cpumask *hk_mask; int ilb_cpu; - hk_mask = housekeeping_cpumask(HK_TYPE_MISC); + hk_mask = housekeeping_runtime_cpumask(HKR_TYPE_SCHED); for_each_cpu_and(ilb_cpu, nohz.idle_cpus_mask, hk_mask) { -- 2.25.1