Re: [RFC] new timeofday core subsystem (v.A1)

From: Christoph Lameter
Date: Wed Dec 08 2004 - 13:54:09 EST


On Tue, 7 Dec 2004, john stultz wrote:

> +/* __monotonic_clock():
> + * private function, must hold system_time_lock lock when being
> + * called. Returns the monotonically increasing number of
> + * nanoseconds since the system booted (adjusted by NTP scaling)
> + */
> +static nsec_t __monotonic_clock(void)
> +{
> + nsec_t ret, ns_offset;
> + cycle_t now, delta;
> +
> + /* read timesource */
> + now = read_timesource(timesource);
> +
> + /* calculate the delta since the last clock_interrupt */
> + delta = (now - offset_base) & timesource->mask;
> +
> + /* convert to nanoseconds */
> + ns_offset = cyc2ns(timesource, delta,0);
> +
> + /* apply the NTP scaling */
> + ns_offset = ntp_scale(ns_offset);

The call to ntp_scale will significantly impact clock retrieval
performance. ntp_scale needs to be removed. Could you simply let the clock
run with a scaling factor (just make sure the scaling factor is a bit
slower than ntp time and then skip a few nanoseconds of time forward
at the next correction?)
-
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/