什么是Linux内核“11分钟模式”可以做的最大硬件时钟更新?

当某些时间相关的程序(如ntpd )在Linux系统上运行时,内核将切换到所谓的“十一分钟模式”(参见hwclock手册页),从而每隔一段时间从系统时钟自动更新硬件时钟十一分钟。

在SLES11上,我已经凭经验确定,如果将硬件时钟设置为比系统时钟晚10小时,则11分钟模式似乎不能使硬件时钟与系统时钟匹配。 但是如果我把硬件时钟设置在系统时钟后面5分钟,那么11分钟模式就是完美匹配。

所以显然有一些最大的更新,11分钟模式可以处理,我想知道这是什么。


更新:

这很奇怪…

更多的实验表明,当HW时钟在系统时钟后面20分钟左右时,11分钟模式会将硬件时钟设置为系统时钟(!)后30分钟:

 # date Tue Dec 6 10:16:52 EST 2011 # hwclock --set --date "12/6/11 09:56" # # date Tue Dec 6 10:17:16 EST 2011 # hwclock --show Tue Dec 6 09:56:06 2011 -0.156551 seconds # # date Tue Dec 6 10:23:09 EST 2011 # hwclock --show Tue Dec 6 10:01:58 2011 -0.535772 seconds # # date Tue Dec 6 10:34:28 EST 2011 # hwclock --show Tue Dec 6 10:04:27 2011 -0.192025 seconds 

更新:

我碰到了这个: https : //bugs.archlinux.org/task/27408这意味着,当硬件时钟离系统时钟时间太远时,内核不会更新硬件时钟。

从RHEL 4.6的hwclock手册页:

 This mode (we'll call it "11 minute mode") is off until something turns it on. The ntp daemon xntpd is one thing that turns it on. You can turn it off by running anything, including hwclock --hctosys, that sets the System Time the old fashioned way. To see if it is on or off, use the command adjtimex --print and look at the value of "status". If the "64" bit of this number (expressed in binary) equal to 0, 11 minute mode is on. Otherwise, it is off. 

所以,由于你运行hwclock --set你可能已经closures了。 同样的道理,你可以检查adjtimex --print的输出来确认。

实际上这与内核中的十一分钟模式无关。 这与ntpd中的一个function有关。

你知道所谓的ntp的健全限制吗? 如果时间太远(例如10小时),ntpd放弃,不会歪斜时钟。 在这些情况下,应该手动运行ntpd或ntpdate。 -g Ntpd选项应该这样做。 检查手册页中的信息:

http://doc.ntp.org/4.1.0/ntpd.htm

如果在“十一分钟”模式下超过60分钟,内核将不会同步时间。 这是SUSE Enterprise中的常见问题,有关更多详细信息,请参阅Open SU​​SE中的此文章: https : //lists.opensuse.org/opensuse-bugs/2011-06/msg01348.html