From owner-freebsd-arch@FreeBSD.ORG Mon Jun 22 00:10:00 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C068106566C; Mon, 22 Jun 2009 00:10:00 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-px0-f203.google.com (mail-px0-f203.google.com [209.85.216.203]) by mx1.freebsd.org (Postfix) with ESMTP id 5FD248FC0C; Mon, 22 Jun 2009 00:10:00 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-px0-f203.google.com with SMTP id 41so2222383pxi.3 for ; Sun, 21 Jun 2009 17:10:00 -0700 (PDT) Received: by 10.143.8.17 with SMTP id l17mr2366251wfi.173.1245629400015; Sun, 21 Jun 2009 17:10:00 -0700 (PDT) Received: from ?10.0.1.198? (udp016664uds.hawaiiantel.net [72.235.41.117]) by mx.google.com with ESMTPS id 31sm1073183wff.24.2009.06.21.17.09.57 (version=SSLv3 cipher=RC4-MD5); Sun, 21 Jun 2009 17:09:58 -0700 (PDT) Date: Sun, 21 Jun 2009 14:09:54 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Marius Strobl In-Reply-To: <20090621140312.GC71667@alchemy.franken.de> Message-ID: References: <20090609201127.GA50903@alchemy.franken.de> <4A2F1148.9090706@freebsd.org> <20090621140312.GC71667@alchemy.franken.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, Peter Grehan Subject: Re: Dynamic pcpu, arm, mips, powerpc, sun, etc. help needed X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 00:10:00 -0000 On Sun, 21 Jun 2009, Marius Strobl wrote: > On Wed, Jun 17, 2009 at 12:55:52PM -1000, Jeff Roberson wrote: >> >> On Tue, 9 Jun 2009, Peter Grehan wrote: >> >>>> As for sparc64 allocating the storage for the dynamic area >>>> from end probably isn't a good idea as the pmap code assumes >>>> that the range from KERNBASE to end is covered by the pages >>>> allocated by and locked into the TLB for the kernel by the >>>> loader >>> >>> Ditto for ppc. It's possible to get the additional space from within or >>> after return from pmap_bootstrap() (like thread0's kstack, or the msgbuf). >> >> http://people.freebsd.org/~jeff/dpcpu.diff >> >> I have updated this patch based on feedback relating to various >> architectures md code. I tried to model most architectures after the way >> msgbuf memory was taken. I have no capacity to test anything other than >> i386 and amd64. ARM is reported to work with one minor diff. Apparently >> sparc64 worked with the earlier diff but this should be cleaner. If >> anyone can report back on sparc64, mips, or powerpc, I'd appreciate it. >> > > The earlier patch worked on sparc64 as long as the kernel > happened to leave enough room in the last 4MB page allocated > for it. > The new version unfortunately doesn't compile on sparc64 as > pmap_bootstrap_alloc() is static to its pmap.c (I think it > should also stay that way). Also the memory allocated with > it isn't safe to be used before we've taken over the trap > table. A kernel built with the sparc64 bits replaced with > the following patch boots fine: > http://people.freebsd.org/~marius/sparc64_dpcpu.diff > Do you have some simple test case for DPCPU which can be > used to verify that it actually works? Thanks very much Marius. I have updated the patch at: http://people.freebsd.org/~jeff/dpcpu.diff I intend to commit this, minus the kern_synch.c diff tomorrow. There was an id in the previous patch that caused each area to be accessed as it was added but you'd have to have done a 'show pcpu' in ddb after boot to access the area. I added a counter in kern_synch.c as a better test. new in this diff: 1) I made each access cheaper by one instruction by making the pc_dynamic pointer relative to the start of the percpu area. 2) I added two helper functions for sysctl ints and quads that can be used for stats. See the temporary kern_synch.c diff for an example. 3) sparc64/sun4v by marius 4) ia64 fixes suggested by marcel. Thanks, Jeff > > Marius >