Re: [PATCH 1/2] Documentation/scheduler: Add cache aware scheduling documentation

From: Shrikanth Hegde

Date: Wed Dec 02 2026 - 01:22:45 EST




On 12/2/26 5:01 AM, Tim Chen wrote:
On Tue, 2026-12-01 at 23:27 +0530, Shrikanth Hegde wrote:
Hi tim, A few nits.


Shrikanth,

Thanks for your review, much appreciated.

<snip>

diff --git a/Documentation/scheduler/index.rst b/Documentation/scheduler/index.rst
index 791178ac8bec..67cf466a169b 100644
--- a/Documentation/scheduler/index.rst
+++ b/Documentation/scheduler/index.rst
@@ -16,6 +16,7 @@ Scheduler
sched-domains
sched-capacity
sched-energy
+ sched-cache
schedutil
sched-util-clamp
sched-nice-design

Should the new entry be added at the end? I don't think the above is sorted.

Right, the list is not sorted. I put it after sched-domains,
sched-capacity and sched-energy on purpose, because those are the
other topology related documents and sched-cache.rst refers to the
same concepts. I would prefer to keep it there, but I don't feel
strongly about it. I can move it to the end if you or Jon prefer.


Almost all of them are related to each other :)

I am okay with the current or at the end. Though I prefer at the end.
But that's not my call.

+The LLC size is read from the generic cacheinfo framework. Architectures
+that do not populate it (currently PowerPC, which has its own cacheinfo
+implementation) report an LLC size of 0. When NUMA balancing is active,
+any non-zero footprint then fails the check of Section 5 (c), so cache
+aware scheduling is effectively disabled on these platforms.

Hopefully below should help.

https://lore.kernel.org/all/20261127152242.306333-1-sshegde@xxxxxxxxxxxxx/#t

Thanks, moving powerpc to the generic cacheinfo is the right fix.
I will drop the mention of PowerPC from this paragraph and keep only
the general statement, so the document does not become stale when
your series is merged.


Keep it there for now. I am not sure which one would get merged.
If that series lands later, i will clean it up along with code comments.



+
+8.4 - NUMA balancing
+^^^^^^^^^^^^^^^^^^^^
+
+The footprint estimate of Section 5 (c) comes from NUMA balancing fault
+statistics. Without NUMA balancing, the footprint check is skipped, and
+groups with a working set much larger than one LLC can still be aggregated.
+With NUMA balancing, the scan is also limited to the relevant nodes, which
+reduces its cost on large systems.
+
+8.5 - Multithreading (SMT)
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The thread limit of Section 5 (b) multiplies the number of running threads
+by the number of hardware threads per core. Thus, it effectively counts
+cores. On systems with many threads per core and small LLCs (for example
+SMT-4 with 4 CPUs per LLC), almost every multi-threaded process fails this
+check unless aggr_tolerance is raised.

Due to above restriction is there a merit in adding a "status" debugfs entry
either per-proc or in llc_balancing where it indicates if the llc_balancing is
effectively disabled due to above HW limitations.

I agree that it is hard to tell today why a process is not
aggregated. The cases are a bit different though:

- No sched domain partition spans more than one LLC. This is a global
state. It is only reported in dmesg with sched_verbose today, and
reading "enabled" returns what the user asked for, not what is in
effect. A read-only file in llc_balancing/ could show it.

- llc_bytes is 0. This is per LLC domain, so it would fit better in
the per domain debugfs directory. Your cacheinfo series should
remove the main case anyway.

- The SMT / LLC size limit above. This is not really a hardware
state. It depends on nr_running_avg of each process and on
aggr_tolerance, so a global file cannot report it. It would need
something per process.


I guess we can start with this, if per proc shows disabled. Since
global is somewhat covered. If a need arises, can be added.

This is a code change, so I would like to keep it out of this
documentation series for now and look at it as a follow-up.

Tim


Ack. It is beyond the scope of this series. I had thought of this
since most users would see enabled and expect it to work, only to
realize later it isn't. Also figuring that out needs explicit
tracing.