diff options
author | John Stultz <john.stultz@linaro.org> | 2014-04-24 07:53:29 +0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-24 02:01:57 +0400 |
commit | 375f45b5b53a91dfa8f0c11328e0e044f82acbed (patch) | |
tree | 1f91a054d833c05bd95db78dd81342a88cf16ea4 /include/ras/ras_event.h | |
parent | dc491596f6394382fbc74ad331156207d619fa0a (diff) | |
download | linux-375f45b5b53a91dfa8f0c11328e0e044f82acbed.tar.xz |
timekeeping: Use cached ntp_tick_length when accumulating error
By caching the ntp_tick_length() when we correct the frequency error,
and then using that cached value to accumulate error, we avoid large
initial errors when the tick length is changed.
This makes convergence happen much faster in the simulator, since the
initial error doesn't have to be slowly whittled away.
This initially seems like an accounting error, but Miroslav pointed out
that ntp_tick_length() can change mid-tick, so when we apply it in the
error accumulation, we are applying any recent change to the entire tick.
This approach chooses to apply changes in the ntp_tick_length() only to
the next tick, which allows us to calculate the freq correction before
using the new tick length, which avoids accummulating error.
Credit to Miroslav for pointing this out and providing the original patch
this functionality has been pulled out from, along with the rational.
Cc: Miroslav Lichvar <mlichvar@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Reported-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/ras/ras_event.h')
0 files changed, 0 insertions, 0 deletions