I've tested the v2 one and met some problems. The cluster level didn't enable/disable as expected.
With no 'sched_cluster' appended:
[root@localhost ~]# cat /proc/sys/kernel/sched_cluster_enabled 0 [root@localhost ~]# cat /proc/cmdline ... schedstats=enable sched_verbose [root@localhost ~]# head /proc/schedstat version 15 timestamp 4295042780 cpu0 3 0 31629 12388 20454 15555 6515381280 3292444020 19176 domain0 00000000,00000000,00000000,0000000f [...] [root@localhost ~]# cat /sys/kernel/debug/sched/domains/cpu0/domain0/name CLS
as noticed, CLS level still appears.
after trying to disable the CLS through sysctl:
[root@localhost ~]# echo 0 > /proc/sys/kernel/sched_cluster_enabled [root@localhost ~]# dmesg | less # No rebuild log did I noticed [...] [root@localhost ~]# cat /sys/kernel/debug/sched/domains/cpu0/domain0/name CLS
And it still doesn't work with 'sched_cluster=0'appended, that the CLS level still appears and cannot be disabled after boot up.
I didn't get a chance to dig into the code, so just provide some infomation here. I applied the patch based on Barry's spread and packing patches, on which your V1 one works. Let me know you want more information. :)
On 2021/7/27 0:08, Tim Chen wrote:
Barry & Yicong,
I've updated the patchset per review comments from Yicong.
Will appreciate your feedback, testing and review.
- Fix incorrect prototype for set_sched_cluster
- Add patch to allow boot time parameter to enable/disable cluster scheduling
Tim Chen (4): sched: Create SDTL_SKIP flag to skip topology level sched: Add SD_CLUSTER topology flag to cluster sched domain sched: Add runtime knob sysctl_sched_cluster_enabled sched: Add boot time enabling/disabling of cluster scheduling
.../admin-guide/kernel-parameters.txt | 4 ++ arch/x86/kernel/smpboot.c | 8 +++ drivers/base/arch_topology.c | 7 ++ include/linux/sched/sd_flags.h | 7 ++ include/linux/sched/sysctl.h | 6 ++ include/linux/sched/topology.h | 3 +- include/linux/topology.h | 1 + kernel/sched/core.c | 1 + kernel/sched/sched.h | 6 ++ kernel/sched/topology.c | 71 ++++++++++++++++++- kernel/sysctl.c | 11 +++ 11 files changed, 123 insertions(+), 2 deletions(-)