From owner-freebsd-smp Wed Feb 5 15: 2:38 2003 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C46FB37B443 for ; Wed, 5 Feb 2003 15:02:34 -0800 (PST) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 135BC43FDB for ; Wed, 5 Feb 2003 15:02:34 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 17772 invoked from network); 5 Feb 2003 23:02:42 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 5 Feb 2003 23:02:42 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id h15N2VUT097620; Wed, 5 Feb 2003 18:02:32 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <001301c2cd69$d23fc550$15008590@GALAXY> Date: Wed, 05 Feb 2003 18:02:40 -0500 (EST) From: John Baldwin To: Peter Marrinon Subject: RE: How is hyperthreading implemented? Cc: freebsd-smp@freebsd.org Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 05-Feb-2003 Peter Marrinon wrote: > I have a couple of questions about how hyperthreading works within FreeBSD: > > 1) Is hyperthreading always a good thing? For instance, I have a CPU-hogging > program that runs as a single process. When I run it on a dual CPU box with > hyperthreading, according to 'top', the process is on one of the 4 virtual > CPU's running at 99% while the other three CPU's sit back twiddling their > thumbs. That indicates that the process is using 49.5% of a physical CPU. Is > that what is really happening or is 'top' too high up in the OS to know > about hyperthreading? What I hope is happening is that my process is > actually using most of the cycles on one of the physical CPU's. Is that > correct? Well, the %cpu that top gets from the kernel is a decayed value, not an instantaneous one. top(1) knows nothing of HT CPUs btw. There are some applications where HTT probably hurts more than it harms, yes. Not all tools are suitable for all jobs. > 2) Does the scheduler know about hyperthreading? When running two CPU hungry > programs I often see the processes on CPU0 and CPU1 with CPU2 and CPU3 being > idle. Now as CPU0 and CPU1 are the same physical CPU, would it not be better > that one of the two processes is running on CPU2 or CPU3 - or have I missed > the point somewhere? The scheduler doesn't know yet. It probably won't ever in 4.x, that will be a new feature in either 6.0 or 5.x someday. > 3) [Off-topic] What is the second T in HTT for? HyperThreading Technology. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message