Re: [PATCH] sched_clock: prevent scd->clock from moving backwards

From: Ingo Molnar
Date: Fri Oct 10 2008 - 05:17:44 EST



* Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx> wrote:

> On Thu, 2008-10-09 at 12:54 -0500, Dave Kleikamp wrote:
>
> > I'll fix the patch and retest it before sending it again.
>
> I'm definitely running with the new patch now. Here goes:
> -------------------------------------------------
> sched_clock: prevent scd->clock from moving backwards
>
> When sched_clock_cpu() couples the clocks between two cpus, it may
> increment scd->clock beyond the GTOD tick window that __update_sched_clock()
> uses to clamp the clock. A later call to __update_sched_clock() may move
> the clock back to scd->tick_gtod + TICK_NSEC, violating the clock's
> monotonic property.
>
> This patch ensures that scd->clock will not be set backward.
>
> Signed-off-by: Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxx>
> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

applied to tip/sched/clock, thanks Dave!

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/