Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Feb 2002 20:15:51 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        John Polstra <jdp@polstra.com>
Cc:        hackers@freebsd.org
Subject:   Re: A question about timecounters 
Message-ID:  <92148.1012936551@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 05 Feb 2002 11:06:08 PST." <200202051906.g15J68E04216@vashon.polstra.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200202051906.g15J68E04216@vashon.polstra.com>, John Polstra writes:
>In article <91801.1012935515@critter.freebsd.dk>,
>Poul-Henning Kamp  <phk@critter.freebsd.dk> wrote:
>> In message <200202051851.g15IpbU04184@vashon.polstra.com>, John Polstra writes:
>> >Yes, I think you're onto something now.  It's a 550 MHz. machine, so
>> >the TSC increments every 1.82 nsec.  And 1.82 nsec * 2^32 is 7.81
>> >seconds. :-)
>> 
>> In that case I'm almost willing to put an AnchorSteam on microuptime()
>> being interrupted for more than good is in which case the splhigh() should
>> cure it.
>
>I'm testing that now.  But for how long would microuptime have to
>be interrupted to make this happen?  Surely not 7.81 seconds!  On
>this same machine I have a curses application running which is
>updating the screen once a second.  It never misses a beat, and
>userland is very responsive.

Well, that is what I don't understand yet either :-)

The fact that the delta is not exactly 2^32 * cpu clock is probably
blindingly obviously indicative of "why", but I havn't solved the
puzzle yet...

Since you are running with a 10000 HZ, NTIMECOUNTER should probably
be considerably increased.  (Actually it might be a good idea to
simply set NTIMECOUNTER == hz ... hmmm...)

We could be seing a situation where a process is preempted in
microuptime() and the timecounter ring being recycled *and*
the hardware counter overflowing before it completes, that might
give this problem.

You didn't say if you ran with standard NTIMECOUNTER right now,
but 5 would be awfully short time at HZ=10000: 500 usec...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

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




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