Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-23 Thread Alan Cox
> >> If we determined tsc early in boot using one of the quick methods: > >> from cpuid/msr/quick_pit, can we assume that frequencies of all other > >> CPUs will be determined the same way? Or do we still have to fallback Not on 32bit at least. You can have a mixed slot 1 SMP system such as an

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-23 Thread Alan Cox
> >> If we determined tsc early in boot using one of the quick methods: > >> from cpuid/msr/quick_pit, can we assume that frequencies of all other > >> CPUs will be determined the same way? Or do we still have to fallback Not on 32bit at least. You can have a mixed slot 1 SMP system such as an

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On 07/19/2018 04:44 PM, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Pavel Tatashin wrote: > >> On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin >> wrote: >>> So create two functions. native_...early..() and native(). The early one does not contain the hpet/pmtimer stuff and it

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On 07/19/2018 04:44 PM, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Pavel Tatashin wrote: > >> On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin >> wrote: >>> So create two functions. native_...early..() and native(). The early one does not contain the hpet/pmtimer stuff and it

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Pavel Tatashin wrote: > On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin > wrote: > > > > > So create two functions. native_...early..() and native(). The early > > > one does not contain the hpet/pmtimer stuff and it replaces the > > > ops.pointer > > > with the late

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Pavel Tatashin wrote: > On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin > wrote: > > > > > So create two functions. native_...early..() and native(). The early > > > one does not contain the hpet/pmtimer stuff and it replaces the > > > ops.pointer > > > with the late

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin wrote: > > > So create two functions. native_...early..() and native(). The early > > one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer > > with the late one which contains all of it. > > Good idea. Actually, the late

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On Thu, Jul 19, 2018 at 12:49 PM Pavel Tatashin wrote: > > > So create two functions. native_...early..() and native(). The early > > one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer > > with the late one which contains all of it. > > Good idea. Actually, the late

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
> So create two functions. native_...early..() and native(). The early > one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer > with the late one which contains all of it. Good idea. Actually, the late one will contain only hpet/pmtimer and I will set it only if tsc

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
> So create two functions. native_...early..() and native(). The early > one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer > with the late one which contains all of it. Good idea. Actually, the late one will contain only hpet/pmtimer and I will set it only if tsc

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Pavel Tatashin wrote: > On 07/19/2018 07:01 AM, Thomas Gleixner wrote: > > And hpet_pmtime_calibrate_cpu() contains all the hpet/pmtime stuff. > > However, when cpu_khz = x86_platform.calibrate_cpu() is called the first > time, we still call hpet_pmtime_calibrate_cpu() from

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Pavel Tatashin wrote: > On 07/19/2018 07:01 AM, Thomas Gleixner wrote: > > And hpet_pmtime_calibrate_cpu() contains all the hpet/pmtime stuff. > > However, when cpu_khz = x86_platform.calibrate_cpu() is called the first > time, we still call hpet_pmtime_calibrate_cpu() from

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On 07/19/2018 07:01 AM, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Peter Zijlstra wrote: >> On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: >>> During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), >>> and the second time in tsc_init(). >>> >>> Rename

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Pavel Tatashin
On 07/19/2018 07:01 AM, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Peter Zijlstra wrote: >> On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: >>> During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), >>> and the second time in tsc_init(). >>> >>> Rename

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Peter Zijlstra wrote: > On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: > > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > > and the second time in tsc_init(). > > > > Rename tsc_early_delay_calibrate() to tsc_early_init(), and

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Peter Zijlstra wrote: > On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: > > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > > and the second time in tsc_init(). > > > > Rename tsc_early_delay_calibrate() to tsc_early_init(), and

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Peter Zijlstra
On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > and the second time in tsc_init(). > > Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so > the calibration is done only early, and

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Peter Zijlstra
On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > and the second time in tsc_init(). > > Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so > the calibration is done only early, and

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Dou Liyang
Hi Thomas, At 07/19/2018 02:25 PM, Thomas Gleixner wrote: On Thu, 19 Jul 2018, Dou Liyang wrote: At 07/18/2018 10:22 AM, Pavel Tatashin wrote: + (unsigned long)cpu_khz % KHZ); if (cpu_khz != tsc_khz) { pr_info("Detected %lu.%03lu MHz TSC", -

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Dou Liyang
Hi Thomas, At 07/19/2018 02:25 PM, Thomas Gleixner wrote: On Thu, 19 Jul 2018, Dou Liyang wrote: At 07/18/2018 10:22 AM, Pavel Tatashin wrote: + (unsigned long)cpu_khz % KHZ); if (cpu_khz != tsc_khz) { pr_info("Detected %lu.%03lu MHz TSC", -

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Dou Liyang wrote: > At 07/18/2018 10:22 AM, Pavel Tatashin wrote: > > + (unsigned long)cpu_khz % KHZ); > > if (cpu_khz != tsc_khz) { > > pr_info("Detected %lu.%03lu MHz TSC", > > - (unsigned long)tsc_khz / 1000, > > -

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-19 Thread Thomas Gleixner
On Thu, 19 Jul 2018, Dou Liyang wrote: > At 07/18/2018 10:22 AM, Pavel Tatashin wrote: > > + (unsigned long)cpu_khz % KHZ); > > if (cpu_khz != tsc_khz) { > > pr_info("Detected %lu.%03lu MHz TSC", > > - (unsigned long)tsc_khz / 1000, > > -

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-18 Thread Dou Liyang
Hi, Pavel I am sorry, I didn't point out typo clearly in the previous version. Please see the concerns below. ;-) At 07/18/2018 10:22 AM, Pavel Tatashin wrote: During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-18 Thread Dou Liyang
Hi, Pavel I am sorry, I didn't point out typo clearly in the previous version. Please see the concerns below. ;-) At 07/18/2018 10:22 AM, Pavel Tatashin wrote: During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename

[PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-17 Thread Pavel Tatashin
During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so the calibration is done only early, and make tsc_init() to use the values already determined in tsc_early_init().

[PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-17 Thread Pavel Tatashin
During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so the calibration is done only early, and make tsc_init() to use the values already determined in tsc_early_init().