mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] powerpc/topology: Introduce llc_override debugfs
@ 2026-10-12 10:20 Shrikanth Hegde
  2026-10-12 10:20 ` [PATCH 1/4] powerpc/topology: Introduce llc_override debug knob Shrikanth Hegde
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Shrikanth Hegde @ 2026-10-12 10:20 UTC (permalink / raw)
  To: maddy, linuxppc-dev, peterz, tim.c.chen
  Cc: sshegde, christophe.leroy, linux-kernel, ritesh.list,
	kprateek.nayak, yu.c.chen, vineethr, vincent.guittot, srikar,
	npiggin, mpe

There is a new feature in scheduler called as Cache Aware Scheduling [1].
It tries to keep related tasks within the same LLC domain while
keeping the system reasonably balanced.

Cache Aware Scheduling assumes that the scheduler LLC domain is large enough
to be a useful placement target. This is true on many systems where an LLC spans
several cores, but not on PowerPC systems where the scheduler-visible LLC is at
the SMT level. In that case, sd_llc_size is effectively the SMT width.

This becomes visible in the capacity check:
        return !fits_capacity((mm->sc_stat.nr_running_avg * cpu_smt_num_threads),
                              scale * per_cpu(sd_llc_size, cpu));

As a result, Cache aware scheduling may be enabled but has no room to operate.

Hence provide a debugfs option to set LLC at specific domain so that
one can try experiment their workload with cache aware scheduling.
This also provides ways to explore it on system with SMT=4 to see if
there are any opportunities to improve or uncover bugs if there is any.

Note it is a debug option and it is recommended to keep it disabled.
There is no performance guarantees across different values.

[1]: https://lore.kernel.org/all/cover.1778703694.git.tim.c.chen@linux.intel.com/

Tim, Chenyu, Peter,
Are there any selftest or patches which is used for
functional validation of cache aware scheduling?
per-LLC occupancy in /proc/{PID}/schedstat may not tell the full
story when there are multiple processes and multiple LLC's.

Atleast for functional verification, we might need one if there is
not one already. The reason being,
- At present, we may need a custom workload. hackbench/schbench are
  wakeup intensive and typically bail out even before load balance.
- stress-ng is per process. So doesn't get cache aware scheduling.
- A selftest could spwan specific number of threads till llc size etc
  and ensure packing happens till core_count(llc_size) by default.
  This could also be used for tunable verfifications.
- Provide an ability to observe how much of the workload was contained
  within the LLC due to cache aware scheduling or number of load
  balances stopped due to preferred llc.

These are some initial thoughts I had. If it sounds ok, I can try to add
a new selftest/kunit test. 

Shrikanth Hegde (4):
  powerpc/topology: Introduce llc_override debug knob
  powerpc/topology: Add docs for llc_override
  powerpc/topology: Update mc/pkg flags based on llc_override
  powerpc/topology: Rebuild sched domains on llc_override change

 Documentation/arch/powerpc/index.rst    |   1 +
 Documentation/arch/powerpc/topology.rst |  27 +++++
 arch/powerpc/kernel/smp.c               | 128 +++++++++++++++++++++++-
 3 files changed, 151 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/arch/powerpc/topology.rst

-- 
2.52.0


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

end of thread, other threads:[~2026-10-12 21:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12 10:20 [PATCH 0/4] powerpc/topology: Introduce llc_override debugfs Shrikanth Hegde
2026-10-12 10:20 ` [PATCH 1/4] powerpc/topology: Introduce llc_override debug knob Shrikanth Hegde
2026-10-12 12:14   ` Srikar Dronamraju
2026-10-12 14:10     ` Shrikanth Hegde
2026-10-12 10:20 ` [PATCH 2/4] powerpc/topology: Add docs for llc_override Shrikanth Hegde
2026-10-12 10:20 ` [PATCH 3/4] powerpc/topology: Update mc/pkg flags based on llc_override Shrikanth Hegde
2026-10-12 10:20 ` [PATCH 4/4] powerpc/topology: Rebuild sched domains on llc_override change Shrikanth Hegde
2026-10-12 12:19 ` [PATCH 0/4] powerpc/topology: Introduce llc_override debugfs Srikar Dronamraju
2026-10-12 14:14   ` Shrikanth Hegde
2026-10-12 21:15 ` Tim Chen

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

all inboxes | Powered by JetHome®