lkml.org 
[lkml]   [2006]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] HZ free ntp
Hi,

On Tue, 12 Dec 2006, john stultz wrote:

> Basically INTERVAL_LENGTH_NSEC defines the NTP interval length that the
> time code will use to accumulate with. In this patch I've pushed it out
> to a full second, but it could be set via config (NSEC_PER_SEC/HZ for
> regular systems, something larger for systems using dynticks).

Why do you want to use such an interval? This makes everything only more
complicated.
The largest possible interval is freq cycles (or 1 second without
adjustments). That is the base interval and without redesigning NTP we
can't change that. This base interval can be subdivided into smaller
intervals for incremental updates.
You cannot choose arbitrary intervals otherwise you get other problems,
e.g. with your patch time_offset handling is broken.

> + /* calculate the length of one NTP adjusted second */
> + second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ);
> + second_length += (s64)CLOCK_TICK_ADJUST;
> + adj_length = (s64)time_freq;
> +
> + /* calculate tick length @ HZ*/
> + tick_length = (second_length << TICK_LENGTH_SHIFT)
> + + (adj_length << (TICK_LENGTH_SHIFT - SHIFT_NSEC));
> + do_div(tick_length, HZ);
> + tick_nsec = tick_length >> TICK_LENGTH_SHIFT;
> +
> +
> + /* calculate interval_length_base */
> + /* XXX - this is broken up to avoid 64bit overlfows */
> + interval_length_base = second_length * INTERVAL_LENGTH_NSEC;
> + interval_length_base <<= 2;
> + do_div(interval_length_base, NSEC_PER_SEC);
> + interval_length_base <<= TICK_LENGTH_SHIFT-2;

You don't have to introduce anything new, it's tick_length that changes
and HZ that becomes a variable in this function.

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

\
 
 \ /
  Last update: 2006-12-13 15:01    [W:0.135 / U:41.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site