Re: [PATCH v3 2/7] sched/fair: Add cgroup_mode: up
From: Peter Zijlstra
Date: Fri Jun 05 2026 - 11:24:31 EST
On Fri, Jun 05, 2026 at 02:40:15PM +0200, Peter Zijlstra wrote:
> Instead of calculating the proportional fraction of the group weight for each
> CPU, just give each CPU the full measure, ignoring these pesky SMP problems.
>
> This makes the SMP cgroup fraction (F_g_n) equal to 1, and ensures a single
> task in a cgroup competes on equal footing to a task in a level above.
>
> However, as already explored, this is not a very good policy because it gets
> the SMP weight distribution wrong. Included for completeness.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> kernel/sched/debug.c | 5 ++++-
> kernel/sched/fair.c | 31 +++++++++++++++++++++++++++++--
> kernel/sched/sched.h | 1 +
> 3 files changed, 34 insertions(+), 3 deletions(-)
>
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -271,6 +271,7 @@ static ssize_t sched_dynamic_write(struc
> if (mode < 0)
> return mode;
>
> + __sched_cgroup_mode_update(mode);
> sched_dynamic_update(mode);
>
> *ppos += cnt;
Yeez, I'm not sute WTF happened here. Let me go fix that up.