RE: [PATCH] x86: Export tsc related information in sysfs

From: Thomas Gleixner
Date: Wed May 26 2010 - 10:41:56 EST


On Wed, 26 May 2010, Dan Magenheimer wrote:
> > From: Thomas Gleixner [mailto:tglx@xxxxxxxxxxxxx]
> >
> > Arch independent solution is to provide information about the current
> > clock source in general. This is _NOT_ a TSC specific problem, you
> > have the same trouble with any other clocksource which gets calibrated
> > and does not take it's frequency as a constant value from boot loader,
> > configuration or some CPU/chipset register. The only missing piece is
> > a frequency member in struct clocksource which needs to be filled in
> > by the arch/machine specific code.
>
> Actually there is already a frequency in struct clocksource except
> it's represented by the two components: mult and shift. Maybe
> it would be best to expose these instead of khz (for all clocksources)
> so as to limit abuse by naive users.

You mean the TSC user space ones ?

> So, Thomas and John, if Brian's patch is modified to provide:
>
> /sys/devices/system/clocksource/clocksource0/current_mult
> /sys/devices/system/clocksource/clocksource0/current_shift
> and/or
> /sys/devices/system/clocksource/clocksource0/current_khz
>
> is that an acceptable arch-independent patch? (And which do
> you prefer?)

I'd rather prefer the frequency interface for a simple reason. It
allows to add a commandline option which provides the NTP folks with a
sensible solution to their calibration problem as I don't see that a
longer calibration time will reliably fix it.

So we'd get a "clocksource_freq=XXX" option which would be applied to
the clocksource which is selected on the command line with
"clocksource=NNN".

John ?

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/