summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorMichael Kelley <mikelley@microsoft.com>2023-06-19 22:02:40 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-06-23 10:33:43 +0300
commite5313f1c540434b18ea57927633b1584c534b14a (patch)
tree3398795c8fdb3361188de37174717ba21ee326ba /Documentation
parent038d454ad996a5e275d46188d65d890d2a243f36 (diff)
downloadlinux-e5313f1c540434b18ea57927633b1584c534b14a.tar.xz
clocksource/drivers/hyper-v: Rework clocksource and sched clock setup
Current code assigns either the Hyper-V TSC page or MSR-based ref counter as the sched clock. This may be sub-optimal in two cases. First, if there is hardware support to ensure consistent TSC frequency across live migrations and Hyper-V is using that support, the raw TSC is a faster source of time than the Hyper-V TSC page. Second, the MSR-based ref counter is relatively slow because reads require a trap to the hypervisor. As such, it should never be used as the sched clock. The native sched clock based on the raw TSC or jiffies is much better. Rework the sched clock setup so it is set to the TSC page only if Hyper-V indicates that the TSC may have inconsistent frequency across live migrations. Also, remove the code that sets the sched clock to the MSR-based ref counter. In the cases where it is not set, the sched clock will then be the native sched clock. As part of the rework, always enable both the TSC page clocksource and the MSR-based ref counter clocksource. Set the ratings so the TSC page clocksource is preferred. While the MSR-based ref counter clocksource is unlikely to ever be the default, having it available for manual selection is convenient for development purposes. Signed-off-by: Michael Kelley <mikelley@microsoft.com> Reviewed-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1687201360-16003-1-git-send-email-mikelley@microsoft.com
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions