Re: [PATCH] tsc: make calibration refinement more robust

2018-11-05 Thread Daniel Vacek
On Sat, Nov 3, 2018 at 11:04 AM, Thomas Gleixner wrote: > Daniel, > > On Fri, 2 Nov 2018, Daniel Vacek wrote: >> On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: >> >> -#define MAX_RETRIES 5 >> >> -#define SMI_TRESHOLD5 >> >> +#define MAX_RETRIES 5 >> >> +#define TSC_THRESHOLD

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-05 Thread Daniel Vacek
On Sat, Nov 3, 2018 at 11:04 AM, Thomas Gleixner wrote: > Daniel, > > On Fri, 2 Nov 2018, Daniel Vacek wrote: >> On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: >> >> -#define MAX_RETRIES 5 >> >> -#define SMI_TRESHOLD5 >> >> +#define MAX_RETRIES 5 >> >> +#define TSC_THRESHOLD

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-03 Thread Thomas Gleixner
Daniel, On Fri, 2 Nov 2018, Daniel Vacek wrote: > On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: > >> -#define MAX_RETRIES 5 > >> -#define SMI_TRESHOLD5 > >> +#define MAX_RETRIES 5 > >> +#define TSC_THRESHOLD(tsc_khz >> 5) > > > > This breaks

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-03 Thread Thomas Gleixner
Daniel, On Fri, 2 Nov 2018, Daniel Vacek wrote: > On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: > >> -#define MAX_RETRIES 5 > >> -#define SMI_TRESHOLD5 > >> +#define MAX_RETRIES 5 > >> +#define TSC_THRESHOLD(tsc_khz >> 5) > > > > This breaks

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-02 Thread Daniel Vacek
Hi Thomas, thanks for checking. On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: > Daniel, > > On Thu, 1 Nov 2018, Daniel Vacek wrote: > > Please use 'x86/tsc:' as prefix. git log path/to/file usually gives you a > reasonable hint about prefixes. Oh, sure thing. The dmesg always prints

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-02 Thread Daniel Vacek
Hi Thomas, thanks for checking. On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: > Daniel, > > On Thu, 1 Nov 2018, Daniel Vacek wrote: > > Please use 'x86/tsc:' as prefix. git log path/to/file usually gives you a > reasonable hint about prefixes. Oh, sure thing. The dmesg always prints

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-01 Thread Thomas Gleixner
Daniel, On Thu, 1 Nov 2018, Daniel Vacek wrote: Please use 'x86/tsc:' as prefix. git log path/to/file usually gives you a reasonable hint about prefixes. > -#define MAX_RETRIES 5 > -#define SMI_TRESHOLD5 > +#define MAX_RETRIES 5 > +#define TSC_THRESHOLD(tsc_khz >> 5) This

Re: [PATCH] tsc: make calibration refinement more robust

2018-11-01 Thread Thomas Gleixner
Daniel, On Thu, 1 Nov 2018, Daniel Vacek wrote: Please use 'x86/tsc:' as prefix. git log path/to/file usually gives you a reasonable hint about prefixes. > -#define MAX_RETRIES 5 > -#define SMI_TRESHOLD5 > +#define MAX_RETRIES 5 > +#define TSC_THRESHOLD(tsc_khz >> 5) This

[PATCH] tsc: make calibration refinement more robust

2018-11-01 Thread Daniel Vacek
The threshold in tsc_read_refs() is constant which may favor slower CPUs but may not be optimal for simple reading of reference on faster ones. Hence make it proportional to tsc_khz to compensate for this. The threshold guards against any disturbance like IRQs, NMIs, SMIs or CPU stealing by host

[PATCH] tsc: make calibration refinement more robust

2018-11-01 Thread Daniel Vacek
The threshold in tsc_read_refs() is constant which may favor slower CPUs but may not be optimal for simple reading of reference on faster ones. Hence make it proportional to tsc_khz to compensate for this. The threshold guards against any disturbance like IRQs, NMIs, SMIs or CPU stealing by host