From nobody Mon May 25 00:09:40 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B11AE3BB9FA; Wed, 20 May 2026 08:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266045; cv=none; b=tdMk0YmkeJUlDJAv7BugDRrRaR3FeDg7YTEql9b3pj2THeoMWf6rM7ykf4V3RG/rZl3FBG6nj16hMtF0KMBkehPNirMlyybqJsviUycW8ohRlJ1wZtfkcQZXGkloK6eOM4xW2KUkajZcfoBJh5hXhuNdvnqv2g0WjKV8dJfipoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266045; c=relaxed/simple; bh=YwYfvEaX8ILGmRAzZ8ulXR27tTlD9DiwtMWDdZaSgow=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=CK29n5tF5gUTkWm0q7ePkI5neUInkepGiFCYj/WgioxtQHPHhydGKhyW85qK/s7SmEjGMDel4nwOJmwfbDmllRQfY3Qj9yEfTK5fYwoNdNPOZuFdlrfLQ+2JtBOfCiTONnxov0w1w6vJMlEjfR+OpvFIKvnPXS4oZQ4P9ItT8O8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gtzULgOj; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gi+JJ5Y6; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gtzULgOj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gi+JJ5Y6" Date: Wed, 20 May 2026 08:34:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779266042; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgQsgHF92C6V/OnauWDahCecZwCciOXDjawDZmfoEHQ=; b=gtzULgOjY+9OW09cXzbdMShRPG+uIBBOhv6Krcfr2mQmDEaxgNd391+7IkG3scPVJNqxkf luTBpGIWZ8xksrqt4wpJ8a6Hm3R3ODDlTnFttMPjLGYfvt+LHIR34rM3zxG5uf3fw0Sr08 l1cwIcB1J5An+yRv38Nhp/mU5D91GaQjLx3Jk5dvLbS6R+GQQquhs+v1S6js15FqtReK6x X/CeHQlU4zFTmBlKlle2Mx49rZw/AnQVzT6Uj/vQmqklDlTKVZVLyXEHxWPlOusKygu/6I mfsM/DBXTEkzUbJpUfof06sD5XTDawdPSW9CcYuLO9u4a5AggysdOb6R6+RSww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779266042; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DgQsgHF92C6V/OnauWDahCecZwCciOXDjawDZmfoEHQ=; b=gi+JJ5Y6JB7BFKPNSS9CVown3PvT4o17sW1wR2ZUaBlZcmDpTDGyN4uzPY1lHQGdWK7eXt tNmmXOm+LxlJ0HAw== From: "tip-bot2 for K Prateek Nayak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Add SIS_UTIL support to select_idle_capacity() Cc: Andrea Righi , K Prateek Nayak , "Peter Zijlstra (Intel)" , Vincent Guittot , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260509180955.1840064-6-arighi@nvidia.com> References: <20260509180955.1840064-6-arighi@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177926604088.711.16798990032529178674.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: 61ea17a63719bac51e1bc50eb39fc637f0fdc06e Gitweb: https://git.kernel.org/tip/61ea17a63719bac51e1bc50eb39fc637f= 0fdc06e Author: K Prateek Nayak AuthorDate: Sat, 09 May 2026 20:07:29 +02:00 Committer: Peter Zijlstra CommitterDate: Tue, 19 May 2026 12:17:39 +02:00 sched/fair: Add SIS_UTIL support to select_idle_capacity() Add to select_idle_capacity() the same SIS_UTIL-controlled idle-scan mechanism, already used by select_idle_cpu(): when sched_feat(SIS_UTIL) is enabled and the LLC domain has sched_domain_shared data, derive the per-attempt scan limit from sd->shared->nr_idle_scan. That bounds the walk on large LLCs: once nr_idle_scan is exhausted, return the best CPU seen so far. The early exit is gated on !has_idle_core so an active idle-core search (SMT with idle cores reported by test_idle_cores()) isn't cut short before it gets a chance to find one. Co-developed-by: Andrea Righi Signed-off-by: Andrea Righi Signed-off-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://patch.msgid.link/20260509180955.1840064-6-arighi@nvidia.com --- kernel/sched/fair.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f69ee5a..69ba882 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8016,6 +8016,7 @@ select_idle_capacity(struct task_struct *p, struct sc= hed_domain *sd, int target) int fits, best_fits =3D ASYM_IDLE_THREAD_MISFIT; int cpu, best_cpu =3D -1; struct cpumask *cpus; + int nr =3D INT_MAX; =20 cpus =3D this_cpu_cpumask_var_ptr(select_rq_mask); cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); @@ -8024,10 +8025,28 @@ select_idle_capacity(struct task_struct *p, struct = sched_domain *sd, int target) util_min =3D uclamp_eff_value(p, UCLAMP_MIN); util_max =3D uclamp_eff_value(p, UCLAMP_MAX); =20 + if (sched_feat(SIS_UTIL) && sd->shared) { + /* + * Same nr_idle_scan hint as select_idle_cpu(), nr only limits + * the scan when not preferring an idle core. + */ + nr =3D READ_ONCE(sd->shared->nr_idle_scan) + 1; + /* overloaded domain is unlikely to have idle cpu/core */ + if (nr =3D=3D 1) + return -1; + } + for_each_cpu_wrap(cpu, cpus, target) { bool preferred_core =3D !has_idle_core || is_core_idle(cpu); unsigned long cpu_cap =3D capacity_of(cpu); =20 + /* + * Stop when the nr_idle_scan is exhausted (mirrors + * select_idle_cpu() logic). + */ + if (!has_idle_core && --nr <=3D 0) + return best_cpu; + if (!choose_idle_cpu(cpu, p)) continue; =20