Re: [chrony-dev] [PATCH] MacOS X drift removal |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] MacOS X drift removal
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Thu, 23 Jul 2015 19:34:42 +1200
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a0-2; h=Feedback-ID:X-Smtpcorp-Track:To:Message-Id:Date: From:Subject; bh=bnV8jLwwBLMTinW//QlIMKjJ5jtAVptRyiesNYZ7cTI=; b=MxoMYyT2NvWp mEkVYvbfsAnA3o0nImceLz1I/abkVTiohIcXt0CwAn79KT/XnK2TslLSc1RKORgxVl/rqQTmrB4Qp cPwcac5HE0v0S3wyQPJKzN1aLzx+NAHB+dQvH9MUsTd+ZDHBGlZrzcmj8MqjryZXJU8tFbM2KOpnV efP7vs5P2nO+xMIjeKC4NCHZlCboY5M8zsG3yPR8b4KiB75gvJExxU7F/ntm4JmJOrgI4t3g5Qn9Q POCYX1HcHr/bSNpHF13r9a/KdZoAOUktBg+IK2T3hX+vXWCYObw3inbz3HQ/u0OzJluHpHvScradV 4JizXRXxJYhYz+uWaJMOCw==;
- Feedback-id: 149811m:149811acx33YQ:149811sUwqfrsgdY:SMTPCORP
I thought about the frequency shift and realised its totally wrong. The problem is coming from the way the MacOS driver is handling rounding erros. I've discarded using the kernel tickadj and just use rounding derived from conversion of adjust_required to timeval.
Incidentally. I think there may be a bug in UTI_DoubleToTimeval()
the line:
frac_part = (long)(0.5 + 1.0e6 * (a - (double)(int_part)));
won't this round towards 0 if the if the double is < 0 ?
e.g -1.75 -> -1.0
Probably better to use round() which will round in the correct direction
I don't know what the implications of changing UTI_DoubleToTimeval() are so I'm not proposing to change it, but it looks odd.
Bryan
> On 23/07/2015, at 7:20 pm, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> On Thu, Jul 23, 2015 at 03:03:16PM +1200, Bryan Christianson wrote:
>> I have some before and after screen shots at http://whatroute.net/chrony/
>> Graphs based on values from tracking.log
>
> Nice graphing tool. The frequency scale is 1us == 1ppm?
Thanks. Yes 1 usec - 1 ppm. Haven't figured out a nice way to display the equivalency
>> 1. rem corr is no longer offset from 0 (well not by much) and has a much lower range
>
> That's good.
>
>> 2. Frequency has changed from approx 20 ppm to about 60 ppm
>
> That's odd. The frequency should stay the same assuming the clock
> control works as intended. There could be some offset adjustment
> getting lost or applied twice.
Yep - see my comments above
>
>> From: Bryan Christianson <bryan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>> Date: Fri, 3 Jul 2015 09:42:28 +1200
>> Subject: [PATCH 1/2] MacOS X - add drift removal based on sys_solaris.c
>
>> From: Bryan Christianson <bryan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>> Date: Thu, 23 Jul 2015 14:36:44 +1200
>> Subject: [PATCH 2/2] MacOS X - drift removal
>
> Should be the two patches merged into one? And is that the correct
> email address?
>
> BTW, you can put comments in the commit body, it doesn't have to be
> all on the subject line.
>
> Thanks,
>
> --
> Miroslav Lichvar
>
> --
> To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
> For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
> Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.
>
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.