What affects context-switching performance?

Milo Hyson milo at cyberlifelabs.com
Mon Dec 29 19:20:22 PST 2003


I have two nearly identical systems: an Athlon XP 2100+ running 
4.5-RELEASE and an Athlon XP 2200+ running 4.9-RELEASE. I recently ran 
the BYTE benchmark suite on the two and discovered something odd. Most 
of the results were as expected -- the slightly faster machine was 
slightly faster. However, the tests that involved context-switching ran 
nearly four times as fast on the SLOWER machine, and it's only ~70 MHz 
different.

The two machines have the same motherboard and BIOS settings. The fact 
that the Dhrystone, integer and floating-point tests showed expected 
results rules out CPU performance as a factor. There is no disk activity 
on either machine during the non-disk tests, ruling out the disk 
subsystem. The slower machine has double the RAM, however the 
context-switching tests are not memory intensive and there are no other 
programs running during the tests. That rules out system memory. Both 
systems have identically configured kernels. That rules out kernel 
configuration. Running sysctl on both systems shows they have nearly 
identical kernal parameters. The only significant difference was the 
presence of kern.fast_vfork=1 on the slower unit. However, setting that 
to zero did not affect the test results.

The only thing I can figure is that the context-switching code in 4.5 is 
better than in 4.9. The fact that kern.fast_vfork is no longer present 
in the 4.9 sources suggests that some modifications were made to that 
part of the kernel between the two versions.

Anybody have any insight into this?

-- 
Milo Hyson
Chief "Mad" Scientist and Director of Asian Operations
CyberLife Labs, LLC




More information about the freebsd-questions mailing list