From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 12 11:28:27 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B418616A4CE for ; Wed, 12 Nov 2003 11:28:27 -0800 (PST) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F3B743FE0 for ; Wed, 12 Nov 2003 11:28:26 -0800 (PST) (envelope-from ellard@eecs.harvard.edu) Received: by mail.eecs.harvard.edu (Postfix, from userid 465) id B487354C4AA; Wed, 12 Nov 2003 14:28:25 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id B16CF54C47E for ; Wed, 12 Nov 2003 14:28:25 -0500 (EST) Date: Wed, 12 Nov 2003 14:28:25 -0500 (EST) From: Daniel Ellard To: freebsd-hackers@freebsd.org Message-ID: <20031112103358.S11644@bowser.eecs.harvard.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Confused about HyperThreading and Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 19:28:27 -0000 Can someone point me at some non-marketing documentation about hyperthreading on the latest Intel chips? I'm seeing some strange performance measurements and I would like to figure out what they mean. My systems have the following CPU: CPU: Intel(R) Xeon(TM) CPU 1.80GHz (1799.81-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf27 Stepping = 7 Features=0xbfebfbff They are running FreeBSD 4.8-RELEASE-p13. I'm running an application that pumps a lot of data quickly over a gigabit NIC (an Alteon AceNIC 1000baseT Gigabit Ethernet, using the ti driver). The network uses normal ethernet frames (MTU=1500) instead of jumbo frames, so there are lots of interrupts. In this case, the system is mostly reading data from the network, in case that makes a difference. The application is multi-threaded, using pthreads. When I run a kernel using the default configuration (no SMP, no APIC), the application takes an average of 8.45 seconds (wall-clock time) to run, and this number is consistent from run to run. When I run a kernel built with either SMP or SMP+APIC, it takes an average of 13.25 seconds, and this number is also quite consistent. (It's not the Alteon; using the Intel Pro/1000 XT server adapter with the em driver gives a similar difference, although the intel NIC is slower.) Interestingly, the CPU utilization for the default kernel is about 75-80%, while for the APIC kernel it is over 95%. My guess would be that something is spinning on a lock in the APIC kernel, but that's just a hunch. My questions: 1. Any idea why the performance plummets from 8.45 seconds to 13.25? 2. Is the situation any better in FreeBSD 5.1 (or 4.9)? I know in 4.9 APIC is turned on by default, but if this is the result than I won't be upgrading to 4.9 any time soon! Thanks, -Dan