From owner-freebsd-mips@FreeBSD.ORG Fri Jan 29 06:31:02 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCEA0106566B for ; Fri, 29 Jan 2010 06:31:02 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id 99C908FC0A for ; Fri, 29 Jan 2010 06:31:02 +0000 (UTC) Received: by pxi13 with SMTP id 13so1167413pxi.3 for ; Thu, 28 Jan 2010 22:31:02 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.142.9.27 with SMTP id 27mr296254wfi.241.1264746662101; Thu, 28 Jan 2010 22:31:02 -0800 (PST) In-Reply-To: <37F434F8-C845-4A20-8188-CA26FB7B8C5C@lakerest.net> References: <20100128.132114.1004138037722505681.imp@bsdimp.com> <66207A08-F691-4603-A6C5-9C675414C91E@lakerest.net> <98a59be81001282130n1776b31bn3f6995b6ef136ff0@mail.gmail.com> <37F434F8-C845-4A20-8188-CA26FB7B8C5C@lakerest.net> From: Juli Mallett Date: Thu, 28 Jan 2010 22:30:42 -0800 X-Google-Sender-Auth: 402c6c7f69579d0a Message-ID: To: Randall Stewart Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-mips@freebsd.org, Neel Natu Subject: Re: Code review: groundwork for SMP X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2010 06:31:02 -0000 On Thu, Jan 28, 2010 at 21:47, Randall Stewart wrote: > Do all of the mips processors have this scratch registers (I guess > I should scope that.. do the ones we care about have a scratch > register).. or is this an optional feature. Not anything like all or even all interesting ones. There are some registers you could try abusing that are widely-available but mostly unused, but most of them would require such a degree of discipline that they're not worth it. (Hell, you could use badvaddr as long as you refreshed it after every TLB miss.) > But I wonder how it compares to a indexed access that doing a > > pcpup = &pcpu[getcpuid()]; The problem is get "getcpuid" is very slow on some systems. If you have a really quick way of getting it, this isn't too bad, but my understanding is that that's one of the key reasons to avoid the array approach. Juli.