lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Dec 2006 14:47:52 +0100 (CET)
From:	Roman Zippel <zippel@...ux-m68k.org>
To:	john stultz <johnstul@...ibm.com>
cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: [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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ