From fb1050ac8e40aaa014291b5b53612d27890c2b09 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 4 Jun 2026 15:15:51 +0200 Subject: [PATCH] sched/fair: Change the default cgroup_mode to concur For all the reasons described in the preceding patches, the way cgroup weight is computed is problematic. However, changing it is bound to also lead to trouble. Esp. since people might have taken to inflating the weight value where they can. Since things are configurable, change the default and hope this serves more people than it hurts, esp. in the longer run. Specifically, this prepares for a flattened runqueue, where the hierarchical weight becomes far more important (F_g^d terms), so getting rid of small F_g is imperative. Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260605124052.080482755%40infradead.org --- kernel/sched/debug.c | 2 +- kernel/sched/fair.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 464d0e429ff9..f54e732e6d97 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -634,7 +634,7 @@ static void debugfs_fair_server_init(void) } #ifdef CONFIG_FAIR_GROUP_SCHED -static int cgroup_mode = 1; +static int cgroup_mode = 2; /* See __sched_cgroup_mode_update(). */ static const char *cgroup_mode_str[] = { diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4a204eb4f9e6..1608c01c36fb 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4915,7 +4915,7 @@ static long calc_up_shares(struct cfs_rq *cfs_rq) return READ_ONCE(tg->shares); } -DEFINE_STATIC_CALL(calc_group_shares, calc_smp_shares); +DEFINE_STATIC_CALL(calc_group_shares, calc_concur_shares); void __sched_cgroup_mode_update(int mode) { @@ -4925,10 +4925,10 @@ void __sched_cgroup_mode_update(int mode) func = &calc_up_shares; break; case 1: - default: func = &calc_smp_shares; break; case 2: + default: func = &calc_concur_shares; break; case 3: