Re: [PATCH v12 11/11] x86/tsc: use tsc early

2018-06-23 Thread Pavel Tatashin
On 06/23/2018 12:56 PM, Thomas Gleixner wrote: > On Thu, 21 Jun 2018, Pavel Tatashin wrote: >> /* >> * Scheduler clock - returns current time in nanosec units. >> */ >> @@ -1354,6 +1364,7 @@ void __init tsc_early_delay_calibrate(void) >> lpj = tsc_khz * 1000; >> do_div(lpj, HZ); >>

Re: [PATCH v12 11/11] x86/tsc: use tsc early

2018-06-23 Thread Pavel Tatashin
On 06/23/2018 12:56 PM, Thomas Gleixner wrote: > On Thu, 21 Jun 2018, Pavel Tatashin wrote: >> /* >> * Scheduler clock - returns current time in nanosec units. >> */ >> @@ -1354,6 +1364,7 @@ void __init tsc_early_delay_calibrate(void) >> lpj = tsc_khz * 1000; >> do_div(lpj, HZ); >>

Re: [PATCH v12 11/11] x86/tsc: use tsc early

2018-06-23 Thread Thomas Gleixner
On Thu, 21 Jun 2018, Pavel Tatashin wrote: > /* > * Scheduler clock - returns current time in nanosec units. > */ > @@ -1354,6 +1364,7 @@ void __init tsc_early_delay_calibrate(void) > lpj = tsc_khz * 1000; > do_div(lpj, HZ); > loops_per_jiffy = lpj; > +

Re: [PATCH v12 11/11] x86/tsc: use tsc early

2018-06-23 Thread Thomas Gleixner
On Thu, 21 Jun 2018, Pavel Tatashin wrote: > /* > * Scheduler clock - returns current time in nanosec units. > */ > @@ -1354,6 +1364,7 @@ void __init tsc_early_delay_calibrate(void) > lpj = tsc_khz * 1000; > do_div(lpj, HZ); > loops_per_jiffy = lpj; > +

[PATCH v12 11/11] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
We want to get timestamps and high resultion clock available to us as early as possible in boot. But, native_sched_clock() outputs time based either on tsc after tsc_init() is called later in boot, or using jiffies when clock interrupts are enabled, which is also happens later in boot. On the

[PATCH v12 11/11] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
We want to get timestamps and high resultion clock available to us as early as possible in boot. But, native_sched_clock() outputs time based either on tsc after tsc_init() is called later in boot, or using jiffies when clock interrupts are enabled, which is also happens later in boot. On the