Re: TSC instead of ACPI: powerd doesn't work anymore (to be expected?)

From: Peter Jeremy <PeterJeremy_at_optushome.com.au>
Date: Tue, 1 Nov 2005 05:00:37 +1100
On Mon, 2005-Oct-31 11:26:38 +0100, Poul-Henning Kamp wrote:
>In message <4365EF7B.1020706_at_freebsd.org>, David Xu writes:
>>We can introduce
>>hrtime_t clock_gethrtime(clockid_t clock) to get hi-resolution time
>>as the one seen in RTLinux, or gethrtime() as seen in Solaris (Daniel
>>Eischen said?)
...
>The open group specifically allow clock_gettime() to implement
>more timescales, so what did those fools go and invent even more
>library functions for ?

gethrtime() dates back to SunOS 4.x and (AFAIK) predates TOG's work.
ISTR it's not really a syscall but just reads the HR clock out of
the magic page with the timer.

I'd also support a move to make gettimeofday() a cheaper syscall
that counts in 1/hz and require the use of clock_gettime() for
accurate timestamps.

This still leaves the issue of the scheduler - do we need an accurate
(and expensive) record of how long a particular process executes?  We
can probably make the timestamps slightly cheaper to obtain since we
only need to keep track of a time difference on a single CPU - there's
no need for inter-CPU synchronisation (because a thread can't migrate
from from CPU to CPU without the scheduler knowing).  It probably
doesn't even matter if the time intervals provided to the scheduler
are inaccurate by a few percent or differ slightly between CPUs.

-- 
Peter Jeremy
Received on Mon Oct 31 2005 - 17:00:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:46 UTC