Re: [PATCH] i386 tsc: remove xtime_lock'ing around cpufreq notifier

From: Jeremy Fitzhardinge
Date: Thu Apr 12 2007 - 15:47:44 EST


Andi Kleen wrote:
> Even on real hardware it's also per CPU, although the errors
> are usually not big. At least the scheduler deals with that by
> only ever comparing time stamps from the same CPU.
>

Well, it uses sched_clock to measure how long something has been asleep,
which is inherently non-per-cpu. But it tries to keep a measure of the
skew between the various runqueue's sched_clocks, so the error doesn't
seem to get too large.

> If you have big deviations between CPUs then it might cause problems
> for non scheduler uses. I guess printk_clock is not critical, but
> it might be a little confusing.

They could be huge differences - unbounded, in fact. It would make
printk fairly hard to interpret, I would think. The only benefit to
using sched_clock in printk is that if you're using it to work out the
startup latencies you won't be confused by stolen time. But I think
that's a fairly small benefit compared to the disadvantage of not being
able to meaningfully compare the timestamps on two printk messages.

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