Re: [PATCH] clockevents: avoid unnecessary reprograming of eventtimer

From: Ingo Molnar
Date: Fri Feb 13 2009 - 03:22:47 EST



* Michael Davidson <md@xxxxxxxxxx> wrote:

> From: Michael Davidson <md@xxxxxxxxxx>
>
> Don't reprogram the event timer if it is already set to expire
> at the correct time.
>
> Signed-off-by: Michael Davidson <md@xxxxxxxxxx>
> ---
> --- linux-2.6.29-rc4.orig/kernel/time/clockevents.c 2009-02-12 13:13:24.000000000 -0800
> +++ linux-2.6.29-rc4/kernel/time/clockevents.c 2009-02-12 13:25:42.525558000 -0800
> @@ -103,6 +103,9 @@
> if (delta <= 0)
> return -ETIME;
>
> + if (ktime_equal(dev->next_event, expires))
> + return 0;
> +

Hm, given that a good high-res source has nanoseconds resolution,
what's the chance of this optimization triggering in practice?
Near zero i think - unless we trigger useless reprogramming without
having added or removed any new timers - but then we should
concentrate on analyzing the reason for that redundant reprogramming.

Does it trigger often for you?

Ingo
--
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/