Re: [chrony-dev] [PATCH] MacOS X dynamic drift removal interval |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] MacOS X dynamic drift removal interval
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Tue, 18 Aug 2015 20:05:22 +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=GvnyCKCKI9KHFCHZDE3I5NJXCrmCmv0cXuSkIX4EX7E=; b=sd26DZJTZjxo kwu+VJcpBKM1Xof0yqc0plu8Yad4u9eMeWLdPyKWhNyBkB76e+vVodWZtK9abg3VqONJuS4zbevMk 0GbXtkRFkCWj4KT7HZ//YWbGjeu9zK2Kg6b8ePWohLdiioa5vsA5/LYPVB7b3Hhzj1me4Hi9CpXYp Nx+ODseZTODB2AH4ThRP0/9/32dcQpq7gfVPhsqZS79WmGUgjarxNm2fpYY5h4ygMDXKcmVfxn84I M3COVbK+itDWEO8504amFm5oQBKrrZuj+0/JQvys7dKifj0ZO4qOA/5UR1E026iPEXQJ0O9LCiCwX BHP+ftnpFbubVy0Sa8wrnA==;
- Feedback-id: 149811m:149811acx33YQ:149811s3BWqw76xz:SMTPCORP
> On 18/08/2015, at 7:56 pm, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> On Tue, Aug 18, 2015 at 01:22:15PM +1200, Bryan Christianson wrote:
>> @@ -120,7 +138,14 @@ start_adjust(void)
>>
>> UTI_DiffTimevalsToDouble(&elapsed, &T1, &T0);
>> accrued_error = elapsed * current_freq;
>> - predicted_error = DRIFT_REMOVAL_INTERVAL / 2.0 * current_freq;
>> +
>> + UTI_DiffTimevalsToDouble(&drift_removal_elapsed, &T1, &Tdrift);
>> + predicted_error = MAX(0.0, (current_drift_removal_interval - drift_removal_elapsed) / 2.0 * current_freq);
>
> If current_freq was negative, wouldn't predicted_error end up as zero?
> I think drift_removal_elapsed needs to be clamped before
> predicted_error is calculated. It shouldn't be negative and it
> shouldn't be larger than current_drift_removal_interval, to not get an
> insane error with both backward and forward clock jumps.
Oops - of course. You're right. I'll fix it now.
--
Bryan Christianson
--
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.