[lunar:linux-kvm][PATCH] Revert "UBUNTU: SAUCE: [kvm] tsc: make tsc= default to reliable"

Dimitri John Ledkov dimitri.ledkov at canonical.com
Wed Feb 8 11:18:47 UTC 2023


This reverts commit da9eb97ad0c58eaee0358f17d5617ee4cbdf8f32.

This one is slightly tricky, for most systems this has no affect as
TSC_CONSTANT feature is available and thus cores are not assumed to be
out of sync at startup. The watchdog remains in place, and the cores
are adjusted periodically, which helps after the host is resumed from
suspend. Reverting this patch does not show any averse systemd-analyse
boot speed impact, probably due to availability of TSC, CONSTANT_TSC
TSC_ADJUST features. If we really want to keep this behaviour, it is
probably best to simply setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE)
the way VMWare and HyperV do, in the kvm.c guest cpu setup.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov at canonical.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 1 -
 arch/x86/kernel/tsc.c                           | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index d82ca5185c..ff56a4fe3f 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6318,7 +6318,6 @@
 			as the stability checks done at bootup.	Used to enable
 			high-resolution timer mode on older hardware, and in
 			virtualized environment.
-			[x86] unreliable: mark tsc clocksource as unreliable.
 			[x86] noirqtime: Do not use TSC to do irq accounting.
 			Used to run time disable IRQ_TIME_ACCOUNTING on any
 			platforms where RDTSC is slow and this accounting
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 169dc4d715..cafacb2e58 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -46,7 +46,7 @@ static unsigned int __initdata tsc_early_khz;
 
 static DEFINE_STATIC_KEY_FALSE(__use_tsc);
 
-int tsc_clocksource_reliable = 1;
+int tsc_clocksource_reliable;
 
 static u32 art_to_tsc_numerator;
 static u32 art_to_tsc_denominator;
@@ -297,8 +297,6 @@ static int __init tsc_setup(char *str)
 {
 	if (!strcmp(str, "reliable"))
 		tsc_clocksource_reliable = 1;
-	if (!strcmp(str, "unreliable"))
-		tsc_clocksource_reliable = 0;
 	if (!strncmp(str, "noirqtime", 9))
 		no_sched_irq_time = 1;
 	if (!strcmp(str, "unstable"))
-- 
2.34.1




More information about the kernel-team mailing list