amd64 cpu_switch in C.

Peter Wemm peter at wemm.org
Wed Mar 12 08:25:18 UTC 2008


On Tue, Mar 11, 2008 at 9:14 PM, David Xu <davidxu at 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.

I'm not confident of testing methodology.  More tests are in progress.

The good news is that this tuning is finally being done.  It should
have been done in 2003 though...

-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at 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


More information about the freebsd-arch mailing list