Subject: Re: Faster pipes, now with uvm_loan()
To: Anders Magnusson <ragge@ludd.luth.se>
From: John Hawkinson <jhawk@MIT.EDU>
List: port-vax
Date: 04/30/2001 10:51:15
| That's pretty ugly/misleading. Is there some way for
| user-level programs to figure out what the time quantum is,
| and perhaps some way for ping to notice and round appropriately?

> No, there are no timers at all (at least that I am aware of) on
> those MicroVAXen that give better resolution. The older VAXen and
> the newer ones have microsecond clocks, but not these.

Ragge and I had a brief offline discussion clarifying what
my question was. Forwarded with permission.

> There is no MI way, but maybe it would be an idea to have a
> sysctl.clockresolution that user programs could read to get the
> gettimeofday() resolution.

| Yeah, I was thinking of something like that.

> Anyway, kern.gettimeofdayresolution (eeek, long name) could return the
> resolution of gettimeofday() value in microseconds.
> If you think this is useful, please go ahead with it. I can think of
> other situations where it also is interesting to get the gettimeofday()
> resolution in programs.

Also, Ben Harris pointed out (quoted without permission, may the gods
strike me down if...):

/ I believe that ntp_adjtime() should tell you that.  Check the "precision"
/ reported by ntptime(1).  Unfotunately, this is dependent on "options NTP",
/ and on the MD code correctly initialising time_precision to something other
/ than 1us (which I don't believe the VAX port does).

Indeed. In sys/kern/{kern_ntptime.c,kern_clock.c}.  It's certainly a
more standardized interface than sysctl, and we should make ports set
time_precision accurately.

On the other hand, I'm not sure it makes sense to implement
a nonfunctional ntp_adjtime() for the non-"options NTP" case.

So perhaps a sysctl would be better. If only there were a more convenient
portable interface...

--jhawk