This is a note to let you know that I've just added the patch titled sched/core: Fix arch_scale_freq_tick() on tickless systems to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sched-core-fix-arch_scale_freq_tick-on-tickless-syst.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6abbcb374d5cc479423241ca6f867fe11d806c41 Author: Yair Podemsky <ypodemsk@xxxxxxxxxx> Date: Wed Nov 30 14:51:21 2022 +0200 sched/core: Fix arch_scale_freq_tick() on tickless systems [ Upstream commit 7fb3ff22ad8772bbf0e3ce1ef3eb7b09f431807f ] In order for the scheduler to be frequency invariant we measure the ratio between the maximum CPU frequency and the actual CPU frequency. During long tickless periods of time the calculations that keep track of that might overflow, in the function scale_freq_tick(): if (check_shl_overflow(acnt, 2*SCHED_CAPACITY_SHIFT, &acnt)) goto error; eventually forcing the kernel to disable the feature for all CPUs, and show the warning message: "Scheduler frequency invariance went wobbly, disabling!". Let's avoid that by limiting the frequency invariant calculations to CPUs with regular tick. Fixes: e2b0d619b400 ("x86, sched: check for counters overflow in frequency invariant accounting") Suggested-by: "Peter Zijlstra (Intel)" <peterz@xxxxxxxxxxxxx> Signed-off-by: Yair Podemsky <ypodemsk@xxxxxxxxxx> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx> Reviewed-by: Valentin Schneider <vschneid@xxxxxxxxxx> Acked-by: Giovanni Gherdovich <ggherdovich@xxxxxxx> Link: https://lore.kernel.org/r/20221130125121.34407-1-ypodemsk@xxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 981e41cc4121..172ec79b66f6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5498,7 +5498,9 @@ void scheduler_tick(void) unsigned long thermal_pressure; u64 resched_latency; - arch_scale_freq_tick(); + if (housekeeping_cpu(cpu, HK_TYPE_TICK)) + arch_scale_freq_tick(); + sched_clock_tick(); rq_lock(rq, &rf);