Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 11:58:48 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        hackers@freebsd.org
Cc:        phk@critter.freebsd.dk
Subject:   Re: A question about timecounters 
Message-ID:  <200202051958.g15JwmV04331@vashon.polstra.com>
In-Reply-To: <92661.1012938731@critter.freebsd.dk>
References:  <92661.1012938731@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <92661.1012938731@critter.freebsd.dk>,
Poul-Henning Kamp  <phk@critter.freebsd.dk> 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




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