Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2001 19:08:48 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        jhb@FreeBSD.ORG (John Baldwin)
Cc:        tlambert@primenet.com (Terry Lambert), freebsd-alpha@FreeBSD.ORG, neugebar@dcs.gla.ac.uk ((Rolf Neugebauer))
Subject:   Re: determine cycle counter frequency in user space
Message-ID:  <200105011908.MAA05338@usr06.primenet.com>
In-Reply-To: <XFMail.010501113539.jhb@FreeBSD.org> from "John Baldwin" at May 01, 2001 11:35:39 AM

next in thread | previous in thread | raw e-mail | index | archive | help
> > Minimally, you will require periodic resynchornization with
> > the kernel drift information stored in timer structure.  You
> > should see /sys/i386/isa/clock.c and the timer code in the
> > file /sys/kern/kern_time.c.
> 
> You have _got_ to be kidding me Terry.  This is freebsd-_alpha_@FreeBSD.org. 
> /sys/i386/anything isn't very relevant here. :)  /sys/alpha would be a better
> place to investigate.  Using microtime or microuptime in the kernel in a
> critical section (or at splhigh for 4.x I would guess) in conjuction with each
> rpcc would be perfectly sufficient:

Sorry; mixesdup my platforms.  I have to salute you: I found the
timecounter code singularly opaque.


> There is still the problem on an SMP system that you may spin on
> a lock in microuptime() while talking to the i8254.  Also, I
> probably fubb'd the priority to tsleep(), and some different
> timeouts might be more optimal.  To be truly pedantic, one could
> make the clock lock allow recursion and do something along
> these lines:

... probably overkill; IMO, you only really care about whichever
processor you are running on.  Too bad you can't synchornize the
cycle counters on any hardware I'm aware of to date.  8-(.

> (In -current of course, in -stable splhigh() instead of the mutex ops would
> probably work as well.)
> 
> This isn't cheap though. :)

I think he probably wants what I wanted: a "gettimeofday()" that
is "close enough for 1ms or better logging" and doesn't require
call overhead.

It's unfortunate that there's no "curtime" that could be abused
to provide this...


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105011908.MAA05338>