Re: time patches by Roman Zippel

From: Ulrich Windl
Date: Tue Feb 14 2006 - 09:07:41 EST


On 14 Feb 2006 at 14:21, Roman Zippel wrote:

> Hi,
>
> On Tue, 14 Feb 2006, Ulrich Windl wrote:
>
> > 15_time_offset and 18_time_freq change some well-known constants (like MAXPHASE)
> > by three orders of magnitude.

--- linux-2.6-mm.orig/include/linux/timex.h 2005-12-21 12:12:00.000000000 +0100
+++ linux-2.6-mm/include/linux/timex.h 2005-12-21 12:12:08.000000000 +0100
@@ -95,11 +95,11 @@
#define SHIFT_USEC 16 /* frequency offset scale (shift) */
#define FINENSEC (1L << SHIFT_SCALE) /* ~1 ns in phase units */

-#define MAXPHASE 512000L /* max phase error (us) */
+#define MAXPHASE 500000000L /* max phase error (ns) */
#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
#define MINSEC 16L /* min interval between updates (s) */
#define MAXSEC 1200L /* max interval between updates (s) */
-#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
+#define NTP_PHASE_LIMIT ((MAXPHASE / 1000) << 5) /* beyond max. dispersion */


> >
> > the new adjtime() (16_time_adjust, 12_time_adj) changes the semantics: Since about
> > Linux 0.99, adjtime() had the adjtime_is_accurate property, i.e. on the long term
> > it behaved like an addition.
>
> I disagree, could you please explain how you come to this conclusion?

+ tick_nsec_curr += time_adjust * 1000 / HZ;

Assuming 1024Hz interrupt frequency:
(1µs * 1000) / 1024 == 0ns; 0 * 1024 == 0µs, not 1µs
(2µs * 1000) / 1024 == 1ns; 1 * 1024 == 1.024µs, not 2µs

> The patches don't change the behaviour beyond that they increase
> resolution and precision. Only the final patch changes the ntp code to
> match the behaviour of ntp reference code without including all its mess.

It's quite hard to tell: The code is very different what I've ever seen.

Regards,
Ulrich

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/