]> git.baikalelectronics.ru Git - kernel.git/commit
x86/aperfmperf: Erase stale arch_freq_scale values when disabling frequency invarianc...
authorYair Podemsky <ypodemsk@redhat.com>
Tue, 10 Jan 2023 16:02:06 +0000 (18:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:12 +0000 (11:28 +0100)
commit0220d8e0bf9e30451670cea2aa340a7bc6b60fb8
tree88a8f63e4dbcc96d94bc077cdde82e1863e56876
parentf0287db90498a256c7f59cfb6c243c537f7b7f3a
x86/aperfmperf: Erase stale arch_freq_scale values when disabling frequency invariance readings

[ Upstream commit 5f5cc9ed992cbab6361f198966f0edba5fc52688 ]

Once disable_freq_invariance_work is called the scale_freq_tick function
will not compute or update the arch_freq_scale values.
However the scheduler will still read these values and use them.
The result is that the scheduler might perform unfair decisions based on stale
values.

This patch adds the step of setting the arch_freq_scale values for all
cpus to the default (max) value SCHED_CAPACITY_SCALE, Once all cpus
have the same arch_freq_scale value the scaling is meaningless.

Signed-off-by: Yair Podemsky <ypodemsk@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230110160206.75912-1-ypodemsk@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/aperfmperf.c