Re: [PATCH v3] x86: tsc: make TSC calibration immune to interrupts
From: Thomas Gleixner
Date: Wed May 25 2011 - 18:23:48 EST
On Thu, 26 May 2011, Kasper Pedersen wrote:
> On 05/25/2011 12:51 PM, Thomas Gleixner wrote:
> >> The 8 additional samples costs us 28 microseconds in startup
> >> time.
> >
> > That's a good reason to avoid the whole conditional thing and just do
> > the best of 5 always.
>
> I do not mind removing it again.
> The additional 170us only happen when quick_pit_calibrate fails,
> and then native_calibrate_tsc burns 30ms extra anyway.
Yes, not worth the extra conditional.
> >> +
> >> + *p = tp;
> >
> > The value is completely uninteresting when we return ULLONG_MAX.
> >
>
> native_calibrate_tsc() depends on *p being written regardless of
> whether we can get a SMI-free reading:
>
> /* We don't have an alternative source, disable TSC */
> if (!hpet && !ref1 && !ref2) {
> printk("TSC: No reference (HPET/PMTIMER) available\n");
> return 0;
> }
>
> this works since acpi_pm_read_early() returns 0 when pmtmr_ioport
> is 0, or CONFIG_X86_PM_TIMER is not set.
>
> Without it we would report "calibration failed" rather than
> "No reference" or "Using PIT" when there is neither pmtimer nor
> hpet.
Fair enough. So a comment might be in order :) That code is fricking
complex just to figure out on which frequency that damn thing runs :(
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/