[git commit master] ntpd: add a comment, no code changes
Denys Vlasenko
vda.linux at googlemail.com
Fri Jan 1 20:59:49 UTC 2010
commit: http://git.busybox.net/busybox/commit/?id=e4844b8a5fb0159281dbdbace333f69f6d3f1b4b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
networking/ntpd.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/networking/ntpd.c b/networking/ntpd.c
index d4754f8..02761b3 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -432,7 +432,7 @@ filter_datapoints(peer_t *p, double t)
sum += dispersion(&p->filter_datapoint[idx], t) / (2 << i);
if (minoff == p->filter_datapoint[idx].d_offset) {
- minoff -= 1;
+ minoff -= 1; /* so that we don't match it ever again */
} else
if (maxoff == p->filter_datapoint[idx].d_offset) {
maxoff += 1;
@@ -447,6 +447,13 @@ filter_datapoints(peer_t *p, double t)
wavg += x; /* add another older6/64 to form older6/32 */
p->filter_offset = wavg;
p->filter_dispersion = sum;
+//TODO: fix systematic underestimation with large poll intervals.
+// Imagine that we still have a bit of uncorrected drift,
+// and poll interval is big. Offsets form a progression:
+// 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7, 0.7 is most recent.
+// The algorithm above drops 0.0 and 0.7 as outliers,
+// and then we have this estimation, ~25% off from 0.7:
+// 0.1/32 + 0.2/32 + 0.3/16 + 0.4/8 + 0.5/4 + 0.6/2 = 0.503125
// +----- -----+ ^ 1/2
// | n-1 |
--
1.6.3.3
More information about the busybox-cvs
mailing list