From nobody Mon May 25 00:09:08 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 990DA3B9D93; Wed, 20 May 2026 08:34:53 +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=1779266095; cv=none; b=V7wOYp8JyHK0mQ8AyzE3nahoQ7jXy0He5LooN7H0PnpPjyJzwE6md7Z94BnEbmkPb301UkGhckTVJZtjwSB4DtErgTrBTg989ZIdOLW9jmRR4k6Jc/pFndv0QV408Hq0MBPIZp0mvhVx/jTsJrbO0tlbqq8uBY440mCPhx08mI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266095; c=relaxed/simple; bh=lS0XGSuG7FozdU2Wan+k92e1JOisjHtDC+/r7JREJkk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=FvN+GahW9YJRMM8FFuEwc1lX8jqWVGnPxBbFALK1IxBgD5qiFt+PSOp+Z4EyMeHLmUl9DYMOUa6asy0A7Uz965DImweuzemWibudey4lLR8EgxF3IpoiUc47ZxB/jXvJalwcW/rSX/JW9EbFjDXo6x+/mWr2ORdymITUK8woxi4= 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=wOvm4oft; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sBszCiS7; 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="wOvm4oft"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sBszCiS7" Date: Wed, 20 May 2026 08:34:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779266092; 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=bsLG9VWX6O9lanYzVn+I9uReqS4y+VH2yNiV91HLbCc=; b=wOvm4oftAKpJma75f33nZr4SDr/ApEh/LSaEjB03uWuhV6sTdLCLsfBeLIGXPT3imuPHQ1 ZYwcgjGE97auTwl28/C9uo+Jh1rD8RE43NuLImlr5wyAwIj/8XxVnelhkw9kjEIFL0s5BT F5Gy34+vx5zwiOAuQT44yQ9zuQInM9WDH68h/6VMq/vb1aChwdeKBVc8sm7l2XoKto2Zvt /ibT9JvNMwZWgPhxVHKANjtTPg5Fx1S4NzjLufKDHN5lHLru4BwdScg1xsWDuXjBiGryma 45dBah1lD5ofCVRJQVt+3FzM3DlR3RoTZapyoqiW1pC4Ut0Xnzo2UMMwb673BA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779266092; 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=bsLG9VWX6O9lanYzVn+I9uReqS4y+VH2yNiV91HLbCc=; b=sBszCiS73TfxRMOtlbVejI/eWtgSyir43gInWwQHfMIqFGD/ig1TBCXZdQGvJOhcg0Txtv +nFnUJ2mYF7CUVCg== From: "tip-bot2 for Tim Chen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/cache: Count tasks prefering destination LLC in a sched group Cc: Chen Yu , Tim Chen , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: =?utf-8?q?=3C3d8502a33a753c4384b368f97f64ee70b1cea0db=2E1775065?= =?utf-8?q?312=2Egit=2Etim=2Ec=2Echen=40linux=2Eintel=2Ecom=3E?= References: =?utf-8?q?=3C3d8502a33a753c4384b368f97f64ee70b1cea0db=2E17750653?= =?utf-8?q?12=2Egit=2Etim=2Ec=2Echen=40linux=2Eintel=2Ecom=3E?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177926609082.711.7261681165310254816.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: 15ad45fb80ca7fe67faf6b51dffce125a801cc5a Gitweb: https://git.kernel.org/tip/15ad45fb80ca7fe67faf6b51dffce125a= 801cc5a Author: Tim Chen AuthorDate: Wed, 01 Apr 2026 14:52:22 -07:00 Committer: Peter Zijlstra CommitterDate: Thu, 09 Apr 2026 15:49:50 +02:00 sched/cache: Count tasks prefering destination LLC in a sched group During LLC load balancing, tabulate the number of tasks on each runqueue that prefer the LLC contains the env->dst_cpu in a sched group. For example, consider a system with 4 LLC sched groups (LLC0 to LLC3) balancing towards LLC3. LLC0 has 3 tasks preferring LLC3, LLC1 has 2, and LLC2 has 1. LLC0, having the most tasks preferring LLC3, is selected as the busiest source to pick tasks from. Within a source LLC, the total number of tasks preferring a destination LLC is computed by summing counts across all CPUs in that LLC. For instance, if LLC0 has CPU0 with 2 tasks and CPU1 with 1 task preferring LLC3, the total for LLC0 is 3. These statistics allow the load balancer to choose tasks from source sched groups that best match their preferred LLCs. Co-developed-by: Chen Yu Signed-off-by: Chen Yu Signed-off-by: Tim Chen Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/3d8502a33a753c4384b368f97f64ee70b1cea0db.177= 5065312.git.tim.c.chen@linux.intel.com --- kernel/sched/fair.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7d52cf0..cea625c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10834,6 +10834,9 @@ struct sg_lb_stats { unsigned int nr_numa_running; unsigned int nr_preferred_running; #endif +#ifdef CONFIG_SCHED_CACHE + unsigned int nr_pref_dst_llc; +#endif }; =20 /* @@ -11328,6 +11331,20 @@ static inline void update_sg_lb_stats(struct lb_en= v *env, if (cpu_overutilized(i)) sgs->group_overutilized =3D 1; =20 +#ifdef CONFIG_SCHED_CACHE + if (sched_cache_enabled()) { + struct sched_domain *sd_tmp; + int dst_llc; + + dst_llc =3D llc_id(env->dst_cpu); + if (llc_id(i) !=3D dst_llc) { + sd_tmp =3D rcu_dereference_all(rq->sd); + if (sd_tmp && (unsigned int)dst_llc < sd_tmp->llc_max) + sgs->nr_pref_dst_llc +=3D sd_tmp->llc_counts[dst_llc]; + } + } +#endif + /* * No need to call idle_cpu() if nr_running is not 0 */