Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628395 > unrolled thread

[PATCH 2/9] x86,tsc: Feed refined TSC calibration into sched_clock

Started byPeter Zijlstra <peterz@infradead.org>
First post2017-04-21 19:50 +0200
Last post2017-04-21 19:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/9] x86,tsc: Feed refined TSC calibration into sched_clock Peter Zijlstra <peterz@infradead.org> - 2017-04-21 19:50 +0200

#1628395 — [PATCH 2/9] x86,tsc: Feed refined TSC calibration into sched_clock

FromPeter Zijlstra <peterz@infradead.org>
Date2017-04-21 19:50 +0200
Subject[PATCH 2/9] x86,tsc: Feed refined TSC calibration into sched_clock
Message-ID<tyKQV-gp-17@gated-at.bofh.it>
For the (older) CPUs that still need the refined TSC calibration, also
update the sched_clock rate.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/kernel/tsc.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1267,6 +1267,7 @@ static void tsc_refine_calibration_work(
 	static int hpet;
 	u64 tsc_stop, ref_stop, delta;
 	unsigned long freq;
+	int cpu;
 
 	/* Don't bother refining TSC on unstable systems */
 	if (check_tsc_unstable())
@@ -1317,6 +1318,10 @@ static void tsc_refine_calibration_work(
 	/* Inform the TSC deadline clockevent devices about the recalibration */
 	lapic_update_tsc_freq();
 
+	/* Update the sched_clock() rate to match the clocksource one */
+	for_each_possible_cpu(cpu)
+		set_cyc2ns_scale(tsc_khz, cpu);
+
 out:
 	if (boot_cpu_has(X86_FEATURE_ART))
 		art_related_clocksource = &clocksource_tsc;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web