Re: sched_clock() uses are broken

From: Mike Galbraith
Date: Wed May 03 2006 - 05:13:34 EST


On Wed, 2006-05-03 at 09:40 +0200, Andi Kleen wrote:
> On Wednesday 03 May 2006 09:09, Mike Galbraith wrote:
>
> > Given that most people are going to end up using the pm_timer anyway, I
> > don't see the point of even having a sched_clock(). If it's jiffy
> > resolution, it's useless. If it's wildly inaccurate (as it is in the
> > SMP case, monotonicity issues aside) it's more than useless.
>
> For sched_clock TSC is always used and it's fine - sched_clock
> doesn't require the guarantees that make TSC often useless otherwise

Regrettable, that's not true.

no command line

now: 4294742814000000 X:6906->timestamp: 4294742813000000
now: 4294743815000000 konqueror:7409->timestamp: 4294743814000000
now: 4294744816000000 kicker:7352->timestamp: 4294744815000000
now: 4294745817000000 konsole:7363->timestamp: 4294745815000000
now: 4294746818000000 konqueror:7409->timestamp: 4294746817000000
now: 4294747819000000 kmix:7388->timestamp: 4294747818000000
now: 4294748820000000 kmix:7388->timestamp: 4294748818000000
now: 4294749821000000 konsole:7363->timestamp: 4294749820000000

command line clock=tsc

now: 124079605551 gconfd-2:7372->timestamp: 124079563934
now: 125079899394 swapper:0->timestamp: 125077929715
now: 126080194639 swapper:0->timestamp: 126077228724
now: 127080489088 swapper:0->timestamp: 127077510347
now: 128080784525 swapper:0->timestamp: 128080615408
now: 129081079685 swapper:0->timestamp: 129080104338
now: 130081375553 evolution:7440->timestamp: 130080376731

If the (expletive deleted) pm timer is enabled in your .config (it is
enabled by default and shall forever remain enabled for all who don't
know the incantation to make pm timer option appear in acpi menu) it is
used unless specifically overridden, which defeats the original purpose
for ever having a high resolution sched_clock().

-Mike

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