lkml.org 
[lkml]   [2017]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/9] x86,tsc: Feed refined TSC calibration into sched_clock
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;

\
 
 \ /
  Last update: 2017-04-21 19:39    [W:0.063 / U:4.840 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site