public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] sched: Introduce Cache aware scheduling
@ 2025-04-21  3:23 Chen Yu
  2025-04-21  3:24 ` [RFC PATCH 1/5] sched: Cache aware load-balancing Chen Yu
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Chen Yu @ 2025-04-21  3:23 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, K Prateek Nayak, Gautham R . Shenoy
  Cc: Juri Lelli, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, Tim Chen, Vincent Guittot,
	Libo Chen, Abel Wu, Madadi Vineeth Reddy, Hillf Danton,
	linux-kernel, Chen Yu

This is a respin of the cache-aware scheduling proposed by Peter[1].
In this patch set, some known issues in [1] were addressed, and the performance
regression was investigated and mitigated.

Cache-aware scheduling aims to aggregate tasks with potential shared resources
into the same cache domain. This approach enhances cache locality, thereby optimizing
system performance by reducing cache misses and improving data access efficiency.

In the current implementation, threads within the same process are considered as
entities that potentially share resources. Cache-aware scheduling monitors the CPU
occupancy of each cache domain for every process. Based on this monitoring, it endeavors
to migrate threads within a given process to its cache-hot domains, with the goal of
maximizing cache locality.

Patch 1 constitutes the fundamental cache-aware scheduling. It is the same patch as [1].
Patch 2 comprises a series of fixes for Patch 1, including compiling warnings and functional
fixes.
Patch 3 fixes performance degradation that arise from excessive task migrations within the
preferred LLC domain.
Patch 4 further alleviates performance regressions when the preferred LLC becomes saturated.
Patch 5 introduces ftrace events, which is used to track task migrations triggered by wakeup
and load balancer. This addition facilitate performance regression analysis.

The patch set is applied on top of v6.14 sched/core,
commit 4ba7518327c6 ("sched/debug: Print the local group's asym_prefer_cpu")

schbench was tested on EMR and Zen3 Milan. An improvement in tail latency was observed when 
the LLC was underloaded; however, some regressions were still evident when the LLC was
saturated. Additionally, the load balance should be adjusted to further address these
regressions.

[1] https://lore.kernel.org/all/20250325120952.GJ36322@noisy.programming.kicks-ass.net/


Chen Yu (4):
  sched: Several fixes for cache aware scheduling
  sched: Avoid task migration within its preferred LLC
  sched: Inhibit cache aware scheduling if the preferred LLC is over
    aggregated
  sched: Add ftrace to track task migration and load balance within and
    across LLC

Peter Zijlstra (1):
  sched: Cache aware load-balancing

 include/linux/mm_types.h       |  44 ++++
 include/linux/sched.h          |   4 +
 include/linux/sched/topology.h |   4 +
 include/trace/events/sched.h   |  51 ++++
 init/Kconfig                   |   4 +
 kernel/fork.c                  |   5 +
 kernel/sched/core.c            |  13 +-
 kernel/sched/fair.c            | 461 +++++++++++++++++++++++++++++++--
 kernel/sched/features.h        |   1 +
 kernel/sched/sched.h           |   8 +
 10 files changed, 569 insertions(+), 26 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-04-29 12:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-21  3:23 [RFC PATCH 0/5] sched: Introduce Cache aware scheduling Chen Yu
2025-04-21  3:24 ` [RFC PATCH 1/5] sched: Cache aware load-balancing Chen Yu
2025-04-21  3:24 ` [RFC PATCH 2/5] sched: Several fixes for cache aware scheduling Chen Yu
2025-04-21  3:25 ` [RFC PATCH 3/5] sched: Avoid task migration within its preferred LLC Chen Yu
2025-04-21  3:25 ` [RFC PATCH 4/5] sched: Inhibit cache aware scheduling if the preferred LLC is over aggregated Chen Yu
2025-04-24  9:22   ` Madadi Vineeth Reddy
2025-04-24 14:11     ` Chen, Yu C
2025-04-24 15:51       ` Tim Chen
2025-04-25  9:13         ` Madadi Vineeth Reddy
2025-04-25 17:29           ` Tim Chen
2025-04-25  8:58       ` Madadi Vineeth Reddy
2025-04-21  3:25 ` [RFC PATCH 5/5] sched: Add ftrace to track task migration and load balance within and across LLC Chen Yu
2025-04-29  3:47 ` [RFC PATCH 0/5] sched: Introduce Cache aware scheduling K Prateek Nayak
2025-04-29 12:57   ` Chen, Yu C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox