Re: 2.6.18-rt7: rollover with 32-bit cycles_t

From: john cooper
Date: Wed Nov 08 2006 - 08:29:25 EST


Daniel Walker wrote:

Seems like the check should really be using something like time_before()
time_after() which takes the rollover into account .. What I don't
understand is why we don't see those on x86 ..

Probably due to the fact it is a 64-bit counter. Even with
a free running rate of 10Ghz it would take nearly 60 years
to wrap.

On PPC and ARM 32-bit counters seems to be common which limits
range unless a prescaler is available. The better solution is
to detect wrap as a prescaled 32 bit measurement will eventually
run out of usable resolution as core frequency increases. That is
assuming 64-bit counters don't eventually show up in these
architectures.

-john

--
john.cooper@xxxxxxxxxxxxxxxxxx
-
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/