From owner-freebsd-arch@FreeBSD.ORG Wed Mar 12 08:51:22 2008 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 51EA51065676; Wed, 12 Mar 2008 08:51:22 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 07B008FC36; Wed, 12 Mar 2008 08:51:21 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (cpe-24-94-75-93.hawaii.res.rr.com [24.94.75.93]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id m2C8pH2W075419; Wed, 12 Mar 2008 04:51:20 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Tue, 11 Mar 2008 22:52:16 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Peter Wemm In-Reply-To: Message-ID: <20080311224903.V1091@desktop> References: <20080310161115.X1091@desktop> <47D758AC.2020605@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, David Xu Subject: Re: amd64 cpu_switch in C. 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: Wed, 12 Mar 2008 08:51:22 -0000 On Wed, 12 Mar 2008, Peter Wemm wrote: > On Tue, Mar 11, 2008 at 9:14 PM, David Xu wrote: >> Jeff Roberson wrote: >> > http://people.freebsd.org/~jeff/amd64.diff >> >> This is a good idea. In fact, according to calling conversion, some >> registers are not needed to be saved across function call, e.g on >> i386, eax, edx, and ecx. :-) but gdb may need them to dig out >> stack variable's value. > > Jeff and I have been having a friendly "competition" today. > > With a UP kernel and INVARIANTS, my initial counter-patch response had > nearly double the gain on my machine. (Jeff 7%, mine: 13.5%). > I changed to compile kernels the same as he did (no invariants, SMP > kernel, but kern.smp.disabled=1). After that, our patch sets were the > same again - both at about 10% gain over baseline. > > I've made a few more changes and am now at 23% improvement over baseline. The question is whether we care to have it in C or not. Given a C and assembly version with similar optimizations the assembly version will always win. However, it's easier to write the optimizations in C. > > I'm not confident of testing methodology. More tests are in progress. To keep everyone else up to date; We're using: http://people.freebsd.org/~jeff/yield.c & yield.sh Given two processes and the scheduling methodology for sched_yield() every yield should trigger a context switch to a new process. > > The good news is that this tuning is finally being done. It should > have been done in 2003 though... Yes indeed, better late than never. > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com > "All of this is for nothing if we don't go to the stars" - JMS/B5 > "If Java had true garbage collection, most programs would delete > themselves upon execution." -- Robert Sewell >