[ntp:questions] Configure FreeBSD or Linux to use stepping clock?

Miroslav Lichvar mlichvar at redhat.com
Fri Dec 16 08:53:51 UTC 2011


On Thu, Dec 15, 2011 at 07:50:08PM +0000, Dave Hart wrote:
> Dr. Mills raised the possibility privately that either FreeBSD or
> Linux might be reconfigured to use a more primitive clock that steps
> once per millisecond or less.  If possible and I am able to accomplish
> it, my testing of these bug 2037 fuzzing changes would be greatly
> assisted.

On Linux, you could set a different kernel clocksource. Perhaps
to jiffies or pit, if available.

Check these files:
/sys/devices/system/clocksource/clocksource0/current_clocksource
/sys/devices/system/clocksource/clocksource0/available_clocksource

Why not degrade the resolution of the clock directly in ntp sources?
In get_systime():
	GET_SYSTIME_AS_TIMESPEC(&ts);
	ts.tv_nsec /= 1000000;
	ts.tv_nsec *= 1000000;

-- 
Miroslav Lichvar


More information about the questions mailing list