Re: [chrony-dev] [PATCH] MacOS X drift removal

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


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.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/