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

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/sched/core.c+3−1
@@ -5504,7 +5504,9 @@ void scheduler_tick(void) · 5503 unmodified lines
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);