Date: Tue, 11 Mar 2008 22:52:16 -1000 (HST) From: Jeff Roberson <jroberson@chesapeake.net> To: Peter Wemm <peter@wemm.org> Cc: arch@freebsd.org, David Xu <davidxu@freebsd.org> Subject: Re: amd64 cpu_switch in C. Message-ID: <20080311224903.V1091@desktop> In-Reply-To: <e7db6d980803120125y41926333hb2724ecd07c0ac92@mail.gmail.com> References: <20080310161115.X1091@desktop> <47D758AC.2020605@freebsd.org> <e7db6d980803120125y41926333hb2724ecd07c0ac92@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 12 Mar 2008, Peter Wemm wrote: > On Tue, Mar 11, 2008 at 9:14 PM, David Xu <davidxu@freebsd.org> 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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080311224903.V1091>