From owner-freebsd-hackers Tue Feb 5 11:19: 3 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id D962537B42C for ; Tue, 5 Feb 2002 11:18:57 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g15JFpM92150; Tue, 5 Feb 2002 20:15:51 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: John Polstra Cc: hackers@freebsd.org Subject: Re: A question about timecounters In-Reply-To: Your message of "Tue, 05 Feb 2002 11:06:08 PST." <200202051906.g15J68E04216@vashon.polstra.com> Date: Tue, 05 Feb 2002 20:15:51 +0100 Message-ID: <92148.1012936551@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200202051906.g15J68E04216@vashon.polstra.com>, John Polstra writes: >In article <91801.1012935515@critter.freebsd.dk>, >Poul-Henning Kamp 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