]> asedeno.scripts.mit.edu Git - linux.git/commit
x86/tsc: Introduce early tsc clocksource
authorPeter Zijlstra <peterz@infradead.org>
Fri, 22 Dec 2017 09:20:13 +0000 (10:20 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 14 Jan 2018 19:18:23 +0000 (20:18 +0100)
commitaa83c45762a242acce9b35020363225a7b59d7c9
tree99a6433c1604f83084702f9486aeb2313956e4bd
parent6d671e1b85c63e7a337ba76c1a154c091545cff8
x86/tsc: Introduce early tsc clocksource

Without TSC_KNOWN_FREQ the TSC clocksource is registered so late that the
kernel first switches to the HPET. Using HPET on large CPU count machines is
undesirable.

Therefore register a tsc-early clocksource using the preliminary tsc_khz
from quick calibration. Then when the final TSC calibration is done, it
can switch to the tuned frequency.

The only notably problem is that the real tsc clocksource must be marked
with CLOCK_SOURCE_VALID_FOR_HRES, otherwise it will not be selected when
unregistering tsc-early. tsc-early cannot be left registered, because then
the clocksource code would fall back to it when we tsc clocksource is
marked unstable later.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: len.brown@intel.com
Cc: rui.zhang@intel.com
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20171222092243.431585460@infradead.org
arch/x86/kernel/tsc.c