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

Peter Jeremy PeterJeremy at optushome.com.au
Mon Oct 31 10:00:44 PST 2005


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


More information about the freebsd-current mailing list