Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 1996 18:05:41 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        davidg@Root.COM, phk@critter.tfs.com
Cc:        CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sys@freefall.freebsd.org, phk@freefall.freebsd.org
Subject:   Re: cvs commit: src/sys/i386/i386 swtch.s vm_machdep.c src/sys/i386/include pcb.h src/sys/i386/isa wd.c
Message-ID:  <199604190805.SAA08335@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>We save about 6 clock cycles in cpu_switch but not caring about %eax :-)

It should save only 1 cycle on a 486 and 0.5 or 1 cycles on a Pentium :-).
Even if the value has to be loaded from memory, it should be in a cache
line next to one of the other values loaded from memory unless the pcb
has unfortunate alignment.  In any case, perhaps we could change the
alignment to save more cycles.

Many more cycles could be saved for the npx switch.  First, some of the
pushls and popls are no longer necessary.  Second, fnsave could be used
directly except on systems using IRQ13.  Third, the npx switch could be
lazier, so that it never occurs if only one process uses the cpu (this
requires calling savectx() from more places, in particular before
swapping out the upages).  This might be useful for doing better on
biased benchmarks.  (If the npx is actively used by several processes
concurrently then lazy switching is a pessimization.)

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604190805.SAA08335>