Re: [PATCH v2 21/23] -- DO NOT APPLY!!! -- sched/cache/stats: Add schedstat for cache aware load balancing
From: Yangyu Chen
Date: Fri Dec 19 2025 - 09:49:00 EST
> On 19 Dec 2025, at 22:41, Chen, Yu C <yu.c.chen@xxxxxxxxx> wrote:
>
> On 12/19/2025 1:03 PM, Yangyu Chen wrote:
>>> On 4 Dec 2025, at 07:07, Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> wrote:
>>>
>>> From: Chen Yu <yu.c.chen@xxxxxxxxx>
>>>
>>> Debug patch only.
>>>
>>> With cache-aware load balancing enabled, statistics related to its activity
>>> are exposed via /proc/schedstat and debugfs. For instance, if users want to
>>> verify metrics like the number of exceeding RSS and nr_running limits, they
>>> can filter the output of /sys/kernel/debug/sched/debug and compute the required
>>> statistics manually:
>>>
>>> llc_exceed_cap SUM: 6
>>> llc_exceed_nr SUM: 4531
>>>
>>> Furthermore, these statistics exposed in /proc/schedstats can be queried manually
>>> or via perf sched stats[1] with minor modifications.
>>>
>> Hi Tim,
>> This patch looks great, especially for multithread Verilator workloads
>> on clustered LLC (like AMD EPYC). I'm discussing with Verilator
>> upstream to disable automatic userspace affinity assignment in
>> Verilator if such feature exist [1]. During the discussion, I think
>> there should be a way for userspace software to detect if such a
>> feature exists. Could we expose it in `/proc/schedstats` to allow
>> userspace software to detect such a feature? We can just use this
>> patch and remove the "DO NOT APPLY" tag.
>
> Thanks for the test Yangyu. Does /sys/kernel/debug/sched/llc_enabled
> work for you?
It requires debugfs being mounted with enough permissions. It’s not
feasible for normal user-space software without root permission.
Thanks,
Yangyu Chen
> Anyway we can try to include /proc/schedstats as the formal one
> in the next version.
>
> Thanks,
> Chenyu
>
>> [1] https://github.com/verilator/verilator/issues/6826#issuecomment-3671287551
>> Thanks,
>> Yangyu Chen