Re: [patch 02/14] remove clocksource inline functions

From: Thomas Gleixner
Date: Fri Aug 14 2009 - 04:18:00 EST


On Fri, 14 Aug 2009, Martin Schwidefsky wrote:
> On Thu, 13 Aug 2009 15:14:34 -0700
> john stultz <johnstul@xxxxxxxxxx> wrote:
> > So you'll need to preserve the cycle_last = 0 line.
>
> Whoa, now that is subtle. Good spotting. I would prefer to reset the
> cycle_last in a resume function though:
>
> Index: linux-2.6/arch/x86/kernel/tsc.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/tsc.c
> +++ linux-2.6/arch/x86/kernel/tsc.c
> @@ -744,10 +744,16 @@ static cycle_t __vsyscall_fn vread_tsc(v
> }
> #endif
>
> +static void resume_tsc(void)
> +{
> + clocksource_tsc.cycle_last = 0;
> +}
> +
> static struct clocksource clocksource_tsc = {
> .name = "tsc",
> .rating = 300,
> .read = read_tsc,
> + .resume = resume_tsc,
> .mask = CLOCKSOURCE_MASK(64),
> .shift = 22,
> .flags = CLOCK_SOURCE_IS_CONTINUOUS |
>
> That puts the subtlety where it belongs.

Ack.

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