From owner-freebsd-smp Mon Aug 5 1:53:45 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 78BE037B400 for ; Mon, 5 Aug 2002 01:53:42 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23A5A43E5E for ; Mon, 5 Aug 2002 01:53:42 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g758re717732; Mon, 5 Aug 2002 01:53:40 -0700 (PDT) (envelope-from rizzo) Date: Mon, 5 Aug 2002 01:53: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: <20020805015340.A17716@iguana.icir.org> References: <20020804182713.A14944@iguana.icir.org> <3D4E1ECB.348978D1@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: <3D4E1ECB.348978D1@mindspring.com>; from tlambert2@mindspring.com on Sun, Aug 04, 2002 at 11:44:27PM -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 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; 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