comp.lang.ada
 help / color / mirror / Atom feed
From: dccoote@werple.mira.net.au (David Coote)
Subject: Re: Timing Ada programs using the DEC UNIX microtimer kernel option
Date: 1998/04/26
Date: 1998-04-26T00:00:00+00:00	[thread overview]
Message-ID: <6hu5lv$l8u$1@eplet.mira.net.au> (raw)
In-Reply-To: 6hu3hr$8v4$1@nntp.Stanford.EDU


[snipped lots of useful stuff.]

>But all Alphas have a high-resolution CPU cycle-counter, or an I/O bus
>cycle-counter to get usec or better resolution.  As well as that,
>there's usually either a PC-compatible timer chip or a cycle-counter
>on the I/O bus.  If you find the CPu clock speed (e.g., via busy-loop
>counting cycles between clockticks early in boot) it's easy to
>interpolate from any of these to usec or 10s of nanosec resolution.
>
>For uniprocessors (like the machines here), you can use CPU cycles
>directly.  Multiprocessors require more care to keep the per-CPU
>cycle-counter value at each realtime clock tick, or the process' clock
>values jump around when context-switching from one CPU to another.  Or
>you can just use a lower-resolution, but shared, IO bus cycle counter.

You can use the rpcc assembler instruction to access the on-chip cycle 
counter. But as you say above there is a problem here with processes swapping 
CPUs on a multi-CPU machine and hence accessing different PCC registers. You 
can use the runon command to ensure a process stays on a CPU but then you're 
interfering with the kernel scheduling algorithm. For this reason our 
customer stuck a requirement in the SRS that specifically forbids using the 
runon command in the production system.
>
>I seem to recall Dave Mills saying that DEC gave him some hardware
>precisely to get NTP and precision timekeeping correct.
>It would be rather odd if DU still doesnt get this right.

I asked DEC USA support if they could give us overhead and resolution figures 
for timing system calls. They recommended that we benchmark these ourselves as 
they don't have anything recent. I asked if DEC could add a system call to the 
OS to give in one system call the CPU utilisation figure (defining CPU 
utilisation as percentage of CPU time divided by elapsed time) of low overhead 
and accuracy/resolution below 1ms, perhaps using the PCC register. (The total 
number of cycles used by a process is preserved on multi-CPU machines when a 
process swaps CPUs.)

They indicated that this could be done but I'm still waiting :(





  reply	other threads:[~1998-04-26  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-25  0:00 Timing Ada programs using the DEC UNIX microtimer kernel option David Coote
1998-04-25  0:00 ` Joe Gwinn
1998-04-26  0:00   ` Jonathan Stone
1998-04-26  0:00     ` David Coote [this message]
1998-04-28  0:00     ` Jeffrey Mogul
1998-04-27  0:00 ` Juan Zamorano Flores
1998-05-01  0:00   ` Short DOSish note (was Re: Timing Ada programs using the DEC UNIX microtimer kernel option) John M. Mills
1998-05-01  0:00     ` Jerry van Dijk
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox