]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sched: add new timeout class for peer transmissions
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 8 Aug 2017 11:27:30 +0000 (13:27 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Aug 2017 07:57:14 +0000 (09:57 +0200)
This allows transmissions in symmetric mode to be scheduled
independently from client transmissions. This reduces maximum delay
in scheduling when chronyd is configured with a larger number of
servers.

ntp_core.c
sched.h

index 600d6abc73c87b2f55316acfe8da8a459b18ef45..2717297e2cbddba77953f0ff305a3d4ae478f77d 100644 (file)
@@ -427,7 +427,8 @@ restart_timeout(NCR_Instance inst, double delay)
   /* Start new timer for transmission */
   inst->tx_timeout_id = SCH_AddTimeoutInClass(delay, get_separation(inst->local_poll),
                                               SAMPLING_RANDOMNESS,
-                                              SCH_NtpSamplingClass,
+                                              inst->mode == MODE_CLIENT ?
+                                                SCH_NtpClientClass : SCH_NtpPeerClass,
                                               transmit_timeout, (void *)inst);
 }
 
diff --git a/sched.h b/sched.h
index 837c914d96bf97c610f781eb7e522bc366eb3c6e..bfb616907f043991940b1f0e1e8dbb13226aafb6 100644 (file)
--- a/sched.h
+++ b/sched.h
@@ -34,7 +34,8 @@ typedef unsigned int SCH_TimeoutID;
 
 typedef enum {
   SCH_ReservedTimeoutValue = 0,
-  SCH_NtpSamplingClass,
+  SCH_NtpClientClass,
+  SCH_NtpPeerClass,
   SCH_NtpBroadcastClass,
   SCH_NumberOfClasses /* needs to be last */
 } SCH_TimeoutClass;