LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-03-2010, 08:12 AM   #1
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Rep: Reputation: 15
kernel clock drifts


Hi,

I am running 2.6.27 kernel on my arm AT91SAM9G20. I am not using ntpd. I sync my kernel time with the reference time and then leave the system for 24 hours. I see that the kernel clock drifts by 8 seconds. Can anyone help me in figuring out the reason behind this. And how to fix this in kernel?

 
Old 08-03-2010, 09:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Too my knowledge this cannot be fixed in the kernel.

The time comes from a crystal on the motherboard. These crystals are good enough to show a roughly correct time, but hardly ever good enough to keep perfect time over longer periods. I've seen big differences in the drift that can occur (from a second over a few days to more the 15 seconds in one day).

Syncing your time with a reliable outside source is the only way to go. If you are already syncing once every 24 hours, you might consider changing the config to do it more often. I personally would use ntpd.

Hope this helps.
 
Old 08-04-2010, 02:57 AM   #3
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Question

Quote:
Originally Posted by druuna View Post
Hi,

Too my knowledge this cannot be fixed in the kernel.

The time comes from a crystal on the motherboard. These crystals are good enough to show a roughly correct time, but hardly ever good enough to keep perfect time over longer periods. I've seen big differences in the drift that can occur (from a second over a few days to more the 15 seconds in one day).

Syncing your time with a reliable outside source is the only way to go. If you are already syncing once every 24 hours, you might consider changing the config to do it more often. I personally would use ntpd.

Hope this helps.



Thanks for the reply.

We have ntpd running on the board. But some of these boards are not connected on network and there we face this drfit issue. Can't we modify in kernel to workaround this issue?

 
Old 08-04-2010, 03:15 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Can't we modify in kernel to workaround this issue?
Like I said before: No you cannot. See comment below.

Last edited by druuna; 08-04-2010 at 11:38 AM. Reason: I was wrong.
 
Old 08-04-2010, 07:46 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Yes, you can adjust system time without ntp and I would assume is available for the ARM.
http://linux.die.net/man/8/adjtimex

You can also compensate for hardware clock drift too. http://linux.die.net/man/8/hwclock

Last edited by michaelk; 08-04-2010 at 07:53 AM.
 
Old 08-18-2010, 11:50 PM   #6
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Does anyone know how to apply correction factor for drift in kernel?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Clock running fast ravspratapsingh Linux - Software 8 07-09-2010 07:12 AM
BYE Clock skew detected. Check the clock on the file server Guardian-Mage Linux - Server 7 04-21-2009 09:48 AM
Abit BD7-II + 2.6 kernel + Clock setup muczy Linux - Hardware 4 02-03-2006 08:34 AM
Kernel 2.6.x running in modulated clock mode wesmont Linux - Hardware 10 05-27-2004 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration