[systemd-devel] [PATCH 5/8] timesyncd: use longer PLL time constant

Miroslav Lichvar mlichvar at redhat.com
Wed Aug 27 07:47:21 PDT 2014


The shortest time constant that is stable with the kernel PLL (compiled
with SHIFT_PLL=2) is about log2 of update interval - 3. Set the constant
to poll - 2 to make room for one missed update.
---
 src/timesync/timesyncd-manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index 9b8b7d3..bd6bc39 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -337,7 +337,7 @@ static int manager_adjust_clock(Manager *m, double offset, int leap_sec) {
                 tmx.modes = ADJ_STATUS | ADJ_NANO | ADJ_OFFSET | ADJ_TIMECONST | ADJ_MAXERROR | ADJ_ESTERROR;
                 tmx.status = STA_PLL;
                 tmx.offset = offset * NSEC_PER_SEC;
-                tmx.constant = log2i(m->poll_interval_usec / USEC_PER_SEC) - 4;
+                tmx.constant = log2i(m->poll_interval_usec / USEC_PER_SEC) - 2;
                 tmx.maxerror = 0;
                 tmx.esterror = 0;
                 log_debug("  adjust (slew): %+.3f sec\n", offset);
-- 
1.9.3



More information about the systemd-devel mailing list