From owner-freebsd-smp Mon Aug 5 2: 2:43 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58DF137B400 for ; Mon, 5 Aug 2002 02:02:41 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1681243E3B for ; Mon, 5 Aug 2002 02:02:41 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g7592eB17942; Mon, 5 Aug 2002 02:02:40 -0700 (PDT) (envelope-from rizzo) Date: Mon, 5 Aug 2002 02:02:40 -0700 From: Luigi Rizzo To: Terry Lambert Cc: smp@freebsd.org Subject: Re: how to create per-cpu variables in SMP kernels ? Message-ID: <20020805020239.B17716@iguana.icir.org> References: <20020804182713.A14944@iguana.icir.org> <3D4E1ECB.348978D1@mindspring.com> <20020805015340.A17716@iguana.icir.org> <3D4E3D55.38ECB8E@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3D4E3D55.38ECB8E@mindspring.com>; from tlambert2@mindspring.com on Mon, Aug 05, 2002 at 01:54:45AM -0700 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Aug 05, 2002 at 01:54:45AM -0700, Terry Lambert wrote: ... > > i am asking because in the code I see several instance of things like > > > > p = curproc; > > > > > > in a context where curproc is not supposed to change. Is there a > > performance bonus in doing this, or not ? > > Yes. Look at the definition of curproc. which was my question in the first place :) From what i have seen, in -current at least, reading one of these variables merely means accessing them through %fs, but other than that they look no different than other globals. Am i wrong ? (in fact, i wonder if the code couldn't be made a little bit smarter -- if as you say these variables are in a specially mapped page, they should look just the same as others, don't they ? cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message