From owner-freebsd-hackers Tue Feb 5 11:58:57 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id EECD137B41F for ; Tue, 5 Feb 2002 11:58:51 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g15Jwno54252; Tue, 5 Feb 2002 11:58:49 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id g15JwmV04331; Tue, 5 Feb 2002 11:58:48 -0800 (PST) (envelope-from jdp) Date: Tue, 5 Feb 2002 11:58:48 -0800 (PST) Message-Id: <200202051958.g15JwmV04331@vashon.polstra.com> To: hackers@freebsd.org From: John Polstra Cc: phk@critter.freebsd.dk Subject: Re: A question about timecounters In-Reply-To: <92661.1012938731@critter.freebsd.dk> References: <92661.1012938731@critter.freebsd.dk> Organization: Polstra & Co., Seattle, WA 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 article <92661.1012938731@critter.freebsd.dk>, Poul-Henning Kamp wrote: > In message <200202051944.g15JiFw04286@vashon.polstra.com>, John Polstra writes: > >I don't follow that. As I read the code, the "current" timecounter > >is only advanced every second -- not every 1/HZ seconds. Why should > >more of them be needed when HZ is large? > > No, only if you have set tco_method to one, if tco_method is zero (default) > we update the timecounter every HZ. Oh, you're right. Sorry, I misread the code. My tco_method is 0, so it will do the update every HZ. > Could you try this combination: > > NTIMECOUNTER = HZ (or even 5 * HZ) > tco_method = 0 > no splhigh protection for microuptime() ? Yep, I'll try that. > If I do > extern volatile struct timecounter *timecounter; > > microtime() > { > struct timecounter *tc; > > tc = timecounter; > > The compiler complains about loosing the volatile thing. > > How do I tell it that it is the contents of the "timecounter" pointer which > is volatile, but now what it points at ? You want: extern struct timecounter *volatile timecounter; and also change the definition of the variable in the .c file. You won't get any warnings from that. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message