[RFC][patch] time applet execution speed

Rob Landley rob at landley.net
Sun Sep 25 22:14:22 UTC 2005


On Sunday 25 September 2005 15:49, Bernhard Fischer wrote:
> On Sat, Sep 24, 2005 at 01:33:18PM -0500, Rob Landley wrote:
> >Does rdtsc work happily across scheduler invocations?
>
> I don't see why it shouldn't. rdtsc and the PPC variant are reading
> a CPU built-in timer source. It will of course wrap every now and
> then, depending on your clock speed, but that's due to it being just
> a 64bit counter.
>
> Using this approach may be inadequate if you do not pin an instance and
> all their children to a single CPU if you happen to be on a bigger NUMA
> machine which may lack synced timers across all CPUs.

Actually, what I meant was more along the lines of if an interrupt comes in, 
that time is credited to this process, and if we're scheduled away and 
something else runs for 1/10 of a second is _that_ credited to this process, 
and isn't it even theoretically possible that the other process could reset 
the timer?

Or is the timer value a register that gets saved in our register profile when 
we schedule?  (In which case migrating from CPU to CPU shouldn't be too bad 
anyway.)

Rob



More information about the busybox mailing list