SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am in a bit of a puzzling situation here. I am running -current and the system time lags with 2 sec per minute behind the hardware clock. The hardware clock is correct.
Basically, it is about adding in the kernel command line something like
Code:
notsc clocksource=hpet
before, you should inspect for the available options
Code:
# the available clocksources
/sys/devices/system/clocksource/clocksource0/available_clocksource
# this one will tell which clocksource you use currently (probably TSC)
/sys/devices/system/clocksource/clocksource0/current_clocksource
Be warned that anything else than TSC or HPET probably would affect seriously the responsiveness of your system.
Last edited by Darth Vader; 01-24-2018 at 01:20 PM.
The issue with the system is that you didn't configure ntp...
Being off by 2 seconds every minute is not a lack of configuring ntp. Small drifts are to be expected, but 2 minutes every hour means there is some other issue causing that much drift. Sure, ntp can correct it whenever it syncs with the server, but it's just covering up the problem...
I think its still probably the best solution. I suspect other solutions would just be ignoring the elephant in the room, that older methods can be unreliable. There is a reason most if not all help on this subject is related to configuring ntp, so unless you have another solution you'd like to propose I'd appreciate it if you didn't mislead the op.
Quote:
The Time Stamp Counter was once an excellent high-resolution, low-overhead way for a program to get CPU timing information. With the advent of multi-core/hyper-threaded CPUs, systems with multiple CPUs, and hibernating operating systems, the TSC cannot be relied upon to provide accurate results — unless great care is taken to correct the possible flaws: rate of tick and whether all cores (processors) have identical values in their time-keeping registers. There is no promise that the timestamp counters of multiple CPUs on a single motherboard will be synchronized. Therefore, a program can get reliable results only by limiting itself to run on one specific CPU. Even then, the CPU speed may change because of power-saving measures taken by the OS or BIOS, or the system may be hibernated and later resumed, resetting the TSC. In those latter cases, to stay relevant, the program must re-calibrate the counter periodically.
i already posted my solution: upgrading to a newer kernel (4.15.0-rc9) fixed the problem. Lagging 2 seconds every minute seemed to me as an indication that something was wrong with the system itself. I can check how kernel 4.14.15 works and if it is also OK -- will write in the requests for -current.
Also, I set up ntp: it failed to sync my clock. I read somewhere that probably my clock was lagging too fast for it to 'catch up'.
Maybe it was even worse than that, my system was gradually falling some 10-15 min behind in a matter of several hours. I did not have the patience to use my stopwatch for so long...
Last edited by solarfields; 01-25-2018 at 07:28 AM.
I can check how kernel 4.14.15 works and if it is also OK -- will write in the requests for -current.
This is from ChangeLog-4.14.15. (24 MHz vs 25 MHz means a little more than 2 secs a minute.)
Code:
commit 8352a3fec216b76b645f583f294efc711b3ca1bd
Author: Len Brown <len.brown@intel.com>
Date: Fri Dec 22 00:27:55 2017 -0500
x86/tsc: Fix erroneous TSC rate on Skylake Xeon
commit b511203093489eb1829cb4de86e8214752205ac6 upstream.
The INTEL_FAM6_SKYLAKE_X hardcoded crystal_khz value of 25MHZ is
problematic:
- SKX workstations (with same model # as server variants) use a 24 MHz
crystal. This results in a -4.0% time drift rate on SKX workstations.
- SKX servers subject the crystal to an EMI reduction circuit that reduces its
actual frequency by (approximately) -0.25%. This results in -1 second per
10 minute time drift as compared to network time.
This issue can also trigger a timer and power problem, on configurations
that use the LAPIC timer (versus the TSC deadline timer). Clock ticks
scheduled with the LAPIC timer arrive a few usec before the time they are
expected (according to the slow TSC). This causes Linux to poll-idle, when
it should be in an idle power saving state. The idle and clock code do not
graciously recover from this error, sometimes resulting in significant
polling and measurable power impact.
Stop using native_calibrate_tsc() for INTEL_FAM6_SKYLAKE_X.
native_calibrate_tsc() will return 0, boot will run with tsc_khz = cpu_khz,
and the TSC refined calibration will update tsc_khz to correct for the
difference.
[ tglx: Sanitized change log ]
Fixes: 6baf3d61821f ("x86/tsc: Add additional Intel CPU models to the crystal quirk list")
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: peterz@infradead.org
Cc: Prarit Bhargava <prarit@redhat.com>
Link: https://lkml.kernel.org/r/ff6dcea166e8ff8f2f6a03c17beab2cb436aa779.1513920414.git.len.brown@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ok, I compiled 4.14.15 and it seems the time is kept accurate. I will of course be checking this later... Thank you Petri, for the quote. And, for the record, my CPU is:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.