From nobody Mon Apr 6 19:59:52 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 E5B9C377ED5; Wed, 18 Mar 2026 08:08:36 +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=1773821318; cv=none; b=eO9QtJQnxhpK3w2U41POjQnzXYEniNUm8T1F+/rWtlIfbqa+veo5+cKbSTv2zyncSZv9e/KooMp6vDyTijs3juRtViiqVAj185Y+N5u0cxtzze0mcaIcARaEJlw5eXH9sT6AJEGCfVPdO1ESqWjGpCh9yEV5Mg8gWS+QojXQzm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773821318; c=relaxed/simple; bh=VJ5dBewFyMWn8sMNNp1HPvbIK1zst39We1VBNhCoQaM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=qU5kGpCRyoJTgCq4K6Cbcdx1ItfCIjLuNXnPpIIsaU+/jxpDDV+OSTiZtRy/nMAeA1A1f9/+TNm7dtByd27MDFzr/2qAyzj3YQU8YQnzTWmYgKfGl8RN551ODcftME6ynbX71aPZIe0eDS5XJIzhiUc1PXcZIpids9Wxpru8mpU= 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=tRxsqVoO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xFt2DVI1; 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="tRxsqVoO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xFt2DVI1" Date: Wed, 18 Mar 2026 08:08:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773821315; 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=4+JhwW06coekxBeANPrpwL3v8OFL3RKUO/tpV79X0Xs=; b=tRxsqVoOXjCOSmin3nKiFeSpVBoKF7tSRIi1KaHSVAaW6TTnB/8DlDEPRkbwXdTdglGL3Q ezyBYpMoeiPHh5AohrYR6xMT3a0MO6G/1huI+gFazaJmYMQSgp+eZNeZSkT4C57BjYJ6WX be6pAbsuHK8A5cNnV+CEGhYry9HE0XOHS/zLCYIwtowTWKdOoBALjxkuqEfnhUEl7GZ3pd cXIoh6fpvt71pelgvM1/kcOtbYxpE+toGqcDc6Bh3PXGAIQxMKcGIylaJ6HYkdfveX66Ty ZdCNl97DnEKfUslFs77Jt2EcbcUHysMcKqFP2tOhNSdQB0RP+aDbBHrTkUaEBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773821315; 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=4+JhwW06coekxBeANPrpwL3v8OFL3RKUO/tpV79X0Xs=; b=xFt2DVI14L2El1KdU24He3taveG0hTs1p9QSGi0tcDzoxSdI/Ikd97WyNGd3xsy2dsHugj 2fMoi+1/jdyx9ZAA== 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: Simplify the entry condition for update_idle_cpu_scan() Cc: K Prateek Nayak , "Peter Zijlstra (Intel)" , Chen Yu , Dietmar Eggemann , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260312044434.1974-9-kprateek.nayak@amd.com> References: <20260312044434.1974-9-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177382131417.1647592.10395325434806804711.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: f1320a8dd8ba6518ddb53ea4e3efcb49dc41d257 Gitweb: https://git.kernel.org/tip/f1320a8dd8ba6518ddb53ea4e3efcb49d= c41d257 Author: K Prateek Nayak AuthorDate: Thu, 12 Mar 2026 04:44:33=20 Committer: Peter Zijlstra CommitterDate: Wed, 18 Mar 2026 09:06:50 +01:00 sched/fair: Simplify the entry condition for update_idle_cpu_scan() Only the topmost SD_SHARE_LLC domain has the "sd->shared" assigned. Simply use "sd->shared" as an indicator for load balancing at the highest SD_SHARE_LLC domain in update_idle_cpu_scan() instead of relying on llc_size. Signed-off-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Chen Yu Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Link: https://patch.msgid.link/20260312044434.1974-9-kprateek.nayak@amd.com --- kernel/sched/fair.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3e24d3e..85c22f0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11234,6 +11234,7 @@ static void update_idle_cpu_scan(struct lb_env *env, unsigned long sum_util) { struct sched_domain_shared *sd_share; + struct sched_domain *sd =3D env->sd; int llc_weight, pct; u64 x, y, tmp; /* @@ -11247,11 +11248,7 @@ static void update_idle_cpu_scan(struct lb_env *en= v, if (!sched_feat(SIS_UTIL) || env->idle =3D=3D CPU_NEWLY_IDLE) return; =20 - llc_weight =3D per_cpu(sd_llc_size, env->dst_cpu); - if (env->sd->span_weight !=3D llc_weight) - return; - - sd_share =3D rcu_dereference_all(per_cpu(sd_llc_shared, env->dst_cpu)); + sd_share =3D sd->shared; if (!sd_share) return; =20 @@ -11285,10 +11282,11 @@ static void update_idle_cpu_scan(struct lb_env *e= nv, */ /* equation [3] */ x =3D sum_util; + llc_weight =3D sd->span_weight; do_div(x, llc_weight); =20 /* equation [4] */ - pct =3D env->sd->imbalance_pct; + pct =3D sd->imbalance_pct; tmp =3D x * x * pct * pct; do_div(tmp, 10000 * SCHED_CAPACITY_SCALE); tmp =3D min_t(long, tmp, SCHED_CAPACITY_SCALE);