Subject: Re: system timekeeping and CPU cycle counters
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/07/2005 07:28:58
On Sun, Jun 26, 2005 at 08:39:22AM +0100, David Laight wrote:
> 
> Christos and I did some testing to try to avoid clock-warp with the
> RTC chip microtime/gettimeofday code, and made things somewhat better,
> but failed to remove all the warping on one of his systems.

Erik - I sent the latest version of that code in a private mail...

> TSC based interval counting should be ok for measuring process cpu
> usage (where it isn't necessary for the sum of the parts to add up
> to wall clock time).

It is worth noting that a significant part of the cost of a process
switch is the microtime() calls unless the TSC counter is used.
Maybe the TSC counter could be used for process timing.
User/system/interrupt could even be counted properly.
non-TSC systems could fall back to the 'counting interrupts' method
to avoid the slow microtime().

	David

-- 
David Laight: david@l8s.co.uk