lkml.org 
[lkml]   [2018]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 09/11] x86/tsc: prepare for early sched_clock
Pavel,

first of all, sorry for my last outburst. I just was in a lousy mood after
staring into too much half baken stuff and failed to make myself stay away
from the computer.

On Sun, 24 Jun 2018, Thomas Gleixner wrote:
> On Sat, 23 Jun 2018, Pavel Tatashin wrote:
> And this early init sequence also needs to pull over the tsc adjust
> magic. So tsc_early_delay_calibrate() which should btw. be renamed to
> tsc_early_init() should have:
>
> {
> cpu_khz = x86_platform.calibrate_cpu();
> tsc_khz = x86_platform.calibrate_tsc();
>
> tsc_khz = tsc_khz ? : cpu_khz;
> if (!tsc_khz)
> return;
>
> /* Sanitize TSC ADJUST before cyc2ns gets initialized */
> tsc_store_and_check_tsc_adjust(true);
>
> calc_lpj(tsc_khz);
>
> tsc_sched_clock_init();
> }

Peter made me look deeper into this and there are a few issues, which I
missed, depending on when some of the resources become available. So we
probably cannot hook all of this into tsc_early_delay_calibrate().

I have an idea how to distangle it and we'll end up in a staged approach,
which looks like this:

1) Earliest one (not sure how early yet)

Attempt to use MSR/CPUID. If not running on a hypervisor this can
try the quick PIT calibration, but nothing else.

2) Post init_hypervisor_platform()

An attempt to use the hypervisor data can be made.

3) Post early_acpi_boot_init()

This can do PIT/HPET based calibration

4) Post x86_dtb_init()

PIT/PMTIMER based calibration

Once tsc_khz is known, no further attempts of calibration are made. I'll
look into that later tonight.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-06-26 17:43    [W:0.240 / U:2.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site