History

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.

Yair Podemsky committed 3 years ago

Commit 7fb3ff21 parent 0a715531 file · +3 −1Browse files

Unified · Split

kernel/sched/core.c+3−1
@@ -5504,7 +5504,9 @@ void scheduler_tick(void) · 5503 unmodified lines
5504 unsigned long thermal_pressure;5504 unsigned long thermal_pressure;
5505 u64 resched_latency;5505 u64 resched_latency;
5506 5506
5507 arch_scale_freq_tick();5507 if (housekeeping_cpu(cpu, HK_TYPE_TICK))
5508 arch_scale_freq_tick();
5509
5508 sched_clock_tick();5510 sched_clock_tick();
5509 5511
5510 rq_lock(rq, &rf);5512 rq_lock(rq, &rf);