Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Aug 2002 01:53:40 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        smp@freebsd.org
Subject:   Re: how to create per-cpu variables in SMP kernels ?
Message-ID:  <20020805015340.A17716@iguana.icir.org>
In-Reply-To: <3D4E1ECB.348978D1@mindspring.com>; from tlambert2@mindspring.com on Sun, Aug 04, 2002 at 11:44:27PM -0700
References:  <20020804182713.A14944@iguana.icir.org> <3D4E1ECB.348978D1@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 04, 2002 at 11:44:27PM -0700, Terry Lambert wrote:
> > I would like to know how does the FreeBSD kernel (both in -current
> > and -stable) handle per-cpu variables such as curproc/curthread, cpuid,
...
> > How expensive is to access them compared to regular variables ?
> 
> Depends on the specific variable's implementation.  If you are asking
> because you want to add one, then don't.  8-).  They damage symmetry

i am asking because in the code I see several instance of things like

	p = curproc;
	<code using p instead of curproc>

in a context where curproc is not supposed to change. Is there a
performance bonus in doing this, or not ?

	cheers
	luigi

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




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