Qua*_*nic 18 linux time kernel
当某些与时间相关的程序(如ntpd)在 Linux 系统上运行时,内核将切换到所谓的“十一分钟模式”(参见hwclock手册页),从而每十一分钟从系统时钟自动更新硬件时钟.
在 SLES11 上,我凭经验确定,如果我将硬件时钟设置为比系统时钟晚 10 小时,11 分钟模式似乎无法使硬件时钟与系统时钟匹配。但是如果我将硬件时钟设置为比系统时钟晚 5 分钟,那么 11 分钟模式就完美匹配了。
所以显然有一些 11 分钟模式可以处理的最大更新,我想知道它是什么。
更新:
这很奇怪...
更多的试验表明,当我身边有系统时钟落后20分钟HW时钟的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
Run Code Online (Sandbox Code Playgroud)
更新:
我遇到了这个:https : //bugs.archlinux.org/task/27408,这确实意味着无论好坏,当硬件时钟时间与系统时钟时间相差太远时,内核都不会更新硬件时钟。
小智 5
来自hwclockRHEL 4.6的手册页:
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.
Run Code Online (Sandbox Code Playgroud)
因此,由于您跑步的优点,您hwclock --set可能已将其关闭。出于同样的原因,您可以检查 的输出adjtimex --print以确认。