Thread (9 messages) 9 messages, 2 authors, 5h ago

[PATCH 0/4] powerpc/topology: Introduce llc_override debugfs

flat view
HOTtoday

From: Shrikanth Hegde <sshegde@linux.ibm.com>
Date: 2026-10-12 10:21:16
Also in: lkml

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/ (local)

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help