Skip to content

Commit 7fb3ff2

Browse files
Yair PodemskyIngo Molnar
authored andcommitted
sched/core: Fix arch_scale_freq_tick() on tickless systems
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: e2b0d61 ("x86, sched: check for counters overflow in frequency invariant accounting") Suggested-by: "Peter Zijlstra (Intel)" <[email protected]> Signed-off-by: Yair Podemsky <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Valentin Schneider <[email protected]> Acked-by: Giovanni Gherdovich <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0a71553 commit 7fb3ff2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5504,7 +5504,9 @@ void scheduler_tick(void)
55045504
unsigned long thermal_pressure;
55055505
u64 resched_latency;
55065506

5507-
arch_scale_freq_tick();
5507+
if (housekeeping_cpu(cpu, HK_TYPE_TICK))
5508+
arch_scale_freq_tick();
5509+
55085510
sched_clock_tick();
55095511

55105512
rq_lock(rq, &rf);

0 commit comments

Comments
 (0)