cvs commit: src/sys/amd64/amd64 machdep.c src/sys/amd64/include
pcpu.h
Peter Wemm
peter at FreeBSD.org
Thu Nov 20 14:54:46 PST 2003
peter 2003/11/20 14:54:45 PST
FreeBSD src repository
Modified files:
sys/amd64/amd64 machdep.c
sys/amd64/include pcpu.h
Log:
Provide a streamlined '#define curthread __curthread()' for amd64 to avoid
the compiler having to parse and optimize the PCPU_GET(curthread) so often.
__curthread() is an inline optimized version of PCPU_GET(curthread) that
knows that pc_curthread is at offset zero in the pcpu struct. Add a
CTASSERT() to catch any possible changes to this. This accounts for
just over a 1% wall clock speedup for total kernel compile/link time,
and 20% compile time speedup on some specific files depending on which
compile options are used.
Approved by: re (jhb)
Revision Changes Path
1.600 +3 -0 src/sys/amd64/amd64/machdep.c
1.41 +10 -0 src/sys/amd64/include/pcpu.h
More information about the cvs-src
mailing list