From owner-freebsd-questions@FreeBSD.ORG Mon Dec 29 19:20:22 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F02F16A4CE for ; Mon, 29 Dec 2003 19:20:22 -0800 (PST) Received: from server.lab.cyberlifelabs.com (adsl-64-142-24-131.sonic.net [64.142.24.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EA0F43D55 for ; Mon, 29 Dec 2003 19:20:21 -0800 (PST) (envelope-from milo@cyberlifelabs.com) Received: from cyberlifelabs.com (beastie.lab.cyberlifelabs.com [192.168.1.3]) hBU3KKvn032933 for ; Mon, 29 Dec 2003 19:20:21 -0800 (PST) (envelope-from milo@cyberlifelabs.com) Message-ID: <3FF0EEF4.4050601@cyberlifelabs.com> Date: Mon, 29 Dec 2003 19:20:20 -0800 From: Milo Hyson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030924 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: What affects context-switching performance? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2003 03:20:22 -0000 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