Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Mar 2005 17:33:02 -0500
From:      em1897@aol.com
To:        freebsd-questions@freebsd.org
Subject:   Re: hyper threading.
Message-ID:  <8C7006AE7E80573-FAC-3B652@mblk-r28.sysops.aol.com>
In-Reply-To: <439876144.20050326220638@wanadoo.fr>
References:  <c6ef380c050326061976f164b@mail.gmail.com> <1641928994.20050326192811@wanadoo.fr> <8C700529A2DFD74-A44-3A157@mblk-d34.sysops.aol.com> <439876144.20050326220638@wanadoo.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
Yes, the theory is very nice; you've done a nice
job reading Intel's marketing garb. However if you
don't have a specific hyperthreading-aware scheduler
and particularly well-written, threaded applications,
you'll lose more than you'll gain. Since FreeBSDs
network stack isn't particularly well threaded, nor
is the scheduler optimized for hyperthreading, you
get a big mess at the kernel level. So if you have
a nice application that does a lot of threaded math
operations, you might think you've achieved something,
But what you've missed is that the overhead to manage
the "better utilization" of the dual-pipelines created
by HT costs more than it gains. Hence, the loss of
performance. The poblem is not at the application level,
but at the kernel level. The SMP overhead is so substantial,
and the OS is working thinking it has 2 processors, that
process switching and interrupt handling slow down
considerably.

A machine with a 50% load UP will run 65-70% load with
HT/SMP running. Like I said, its easily measurable. Thats
at the kernel level (say routing or bridging performance).
Now if the machine isn't a server, it may be just fine.
Thats why I suggested testing. But for a network server
HT is bad. Very Bad.

Not only that, but FreeBSD 5.x actually has a higher
capacity network-wise with 1 processor than 2, and
I'm sure you can theorize why 2 processors should be
faster than one. The theory only matters if you have
well written code to handle it properly. FreeBSD is
a long way off from that.

-----Original Message-----
From: Anthony Atkielski <atkielski.anthony@wanadoo.fr>
To: freebsd-questions@freebsd.org
Sent: Sat, 26 Mar 2005 22:06:38 +0100
Subject: Re: hyper threading.

em1897@aol.com writes:

> You'll get much better performance with 1 processor in
> UP mode. I suggest you do some testing.

Where can I see the results of your own exhaustive tests?

The purpose of hyperthreading is to keep all hardware on the
microprocessor working.  Many instructions use only certain parts of the
chip, leaving other parts idle.  By allowing two execution contexts to
be maintained simultaneously, hyperthreading makes it possible to better
utilize hardware that might otherwise sit idle.  The ideal case would be
two threads executing completely different instruction sequences that
use very different parts of this chip.  I don't have exact figures but
I'd guess that in ideal situations you might get 20%-30% extra out of a
single processor in this way--enough to negate the greater overhead of
the SMP logic.

A situation in which hyperthreading would _not_ help would be any type
of parallel processing, in which multiple threads execute very similar
instructions.  These instructions are likely to require the same parts
of the microprocessor at the same time, so it's unlikely that they will
be able to execute in parallel--one will have to wait for the other
(because the microprocessor has logic areas that can function
independently and simultaneously, but these areas don't do the same
things, so they are not redundant logic).

--
Anthony


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
"freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8C7006AE7E80573-FAC-3B652>