Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Feb 2003 18:02:40 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Peter Marrinon <peterm@telstra.net>
Cc:        freebsd-smp@freebsd.org
Subject:   RE: How is hyperthreading implemented?
Message-ID:  <XFMail.20030205180240.jhb@FreeBSD.org>
In-Reply-To: <001301c2cd69$d23fc550$15008590@GALAXY>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030205180240.jhb>