Linux Kernel Clock Source

General questions regarding Linux.

Moderators: Terry, FWLUG Administrator

Linux Kernel Clock Source

Postby Randy » Mon Jun 21, 2010 10:54 pm

I know this is probably pretty obscure, but I have to ask...

Does anyone know how the Linux kernel determines which clocksource (shown in /sys/devices/system/clocksource/clocksource0/current_clocksource) to use? On reboots, it seems to switch randomly between using tsc and hpet.


Background:
I have a system that has (had?) an issue with giant offset/jitter with NTP. It only does this when the current_clocksource is set for tsc (time stamp clock). When I switch it to hpet (high precision event timer), it performs normally. I read that there are some issues with using tsc on AMD Athlon 64-bit processors, but it wasn't overly clear. I'm using clocksource=hpet in the grub configuration. This should always use hpet from now on.

Anyway, if you find your system clock running extremely fast or extremely slow, it may be related to this. But, I haven't found anything that tells me how the current_clocksource is set at boot time. Any help is greatly appreciated.

By the way, this is on one of the PBX systems I've recently deployed. With the time source so far out-of-whack, it appears this has several things (parking lot, call transfers, paging) not working properly. I'll know more tomorrow as applied my "fix" late in the day.
-- Randy
User avatar
Randy
Site Admin
 
Posts: 351
Joined: Mon Feb 13, 2006 9:45 pm
Location: Fort Worth, Texas

Re: Linux Kernel Clock Source

Postby Randy » Tue Jun 22, 2010 9:45 am

I've uploaded a picture so you can see the difference in NTP. The left side of the graph is with clocksource set to tsc and right side where NTP appears flat is with clocksource set to hpet.
Attachments
localhost-ntp_aasrtr2-day.png
NTP tsc versus hpet clocksource
localhost-ntp_aasrtr2-day.png (29.41 KiB) Viewed 6212 times
Last edited by Randy on Tue Jun 22, 2010 9:51 am, edited 1 time in total.
Reason: Spelling
-- Randy
User avatar
Randy
Site Admin
 
Posts: 351
Joined: Mon Feb 13, 2006 9:45 pm
Location: Fort Worth, Texas


Return to FWLUG General Discussions

Who is online

Users browsing this forum: No registered users and 56 guests

cron