Re: How useful is Hyper-Threading for average user?

From: John-Paul Stewart (jpstewart_at_sympatico.ca)
Date: 08/13/03


Date: Tue, 12 Aug 2003 18:50:21 -0400


[Note: follow-ups set to comp.os.linux.hardware. My comments are all
specific to my experiences with Hyper-Threading under Linux.]

John Brock wrote:
>
> I'm planning on buying a new PC this week (there's a sale!), and
> I have the option of buying a 2.8GHz P4 with a 533MHz FSB or a
> 2.8GHz P4 with Hyper-Threading and an 800MHz FSB for almost the
> same price. My first question is does this matter at all for the
> average user (word processing, web browsing, multi-media, etc.)?

Not really. For word processing and web browsing, any current CPU is
going to spend the *vast* majority of its time idle, waiting for user
interaction. IMHO, you will see *zero* difference between HT/non-HT
systems with those apps. (Unless you're running something
compute-intensive in the background. In that case, the HT-enabled
system *may* be able to give more cycles to the background thread.)
Multi-media might be a somewhat different case. Hyperthreading can
speed things up (various benchmarks have shown 25-40% increases...far
from double), however it can also slow things down.

With dual (physical) Xeons in this system and without hyperthreading, a
Linux kernel compile takes about 1min 30sec using 'make -j2'. Enabling
hyperthreading (4 virtual CPUs), 'make -j2' results in a much longer
kernel compile time of about 1min 47sec. 'make -j4' with HT enabled
brings it down to 1min 27sec. Hardly a dramatic improvement (3sec) over
'make -j2' without HT enabled.

It is hard to say how your applications will behave without benchmarking
the particular "multi-media" applications to which you refer.

> I also want to understand a little better what is going on. It
> sounds like HT is equivalent to a dual CPU on a single chip. Is
> that right?

That's the concept, although in reality it doesn't perform the same as
dual physical CPUs.

> Is the 2.8GHz HT system effectively the equivalent of
> a hypothetical system with two physical non-HT 2.8 GHz CPUs?

To the OS, yes it appears essentially that way. But performance-wise,
it is *much* closer to a single 2.8GHz system. Dual physical CPUs
result in much greater speedups (on multi-threaded code).

> Does
> that mean that if I am running a compute intensive process in the
> background the HT system will assign it to one virtual CPU while
> the other is entirely free for whatever else I might want to do?

AIUI, the "second" CPU is only available when the first is waiting for
something (e.g., stalled during memory access). If there is a thread
operating full speed ahead (everything in cache, for example), then HT
doesn't have a chance to get in there and do anything. Compare that to
two physical CPUs, where activity on one is (almost) irrelevant to the
other.

> That certainly sounds like it would occasionally be useful, and
> certainly worth the small extra price.
>
> But are there any drawbacks? Any at all?

Yes. Hyperthreading could slow down some applications in some
circumstances.

That said, IMHO hyper-threading is non-issue when making a purchasing
decision. It's not something I'd pay extra for, but it is also not
something I'd omit just to save a couple of bucks. Ask yourself this:
is the 800MHz FSB alone worth the extra price?

Remember, too, that hyperthreading can be turned on/off in the BIOS. If
the price difference isn't too much, go for the HT system and benchmark
and experiment for yourself!

> Is there *any* operating
> system or application which will choke or fail to run properly on
> an HT system? (I'm not talking about failing to fully take advantage
> of both virtual CPU's, I mean actually failing). If I want to run
> Linux (or BSD, or MS-DOS for that matter) will I *ever* run into
> problems?

No serious problems with current Linux kernels. There were some minor
glitches (slow performance) in the early days of hyper-threading. Now
that the kernel scheduler is more aware of HT-specific issues, those
problems are gone. No outright failures that I'm aware of.



Relevant Pages

  • Re: How useful is Hyper-Threading for average user?
    ... | specific to my experiences with Hyper-Threading under Linux.] ... But once you get more CPUs ... The jump from two to four physical CPUs is ... | operating full speed ahead (everything in cache, for example), then HT ...
    (comp.os.linux.hardware)
  • Re: 20 basic Linux newbie commands to identify the system
    ... > What about hyper-threading? ... I don't know anything about hyperthreading. ... How do I tell if my command above told me the machine under test is ... merely 4 times hyperthreaded or if the machine actually has 4 CPUs? ...
    (linux.redhat.install)
  • Re: 20 basic Linux newbie commands to identify the system
    ... > What about hyper-threading? ... I don't know anything about hyperthreading. ... How do I tell if my command above told me the machine under test is ... merely 4 times hyperthreaded or if the machine actually has 4 CPUs? ...
    (comp.os.linux.setup)
  • Re: 20 basic Linux newbie commands to identify the system
    ... > What about hyper-threading? ... I don't know anything about hyperthreading. ... How do I tell if my command above told me the machine under test is ... merely 4 times hyperthreaded or if the machine actually has 4 CPUs? ...
    (comp.os.linux.misc)
  • Re: 20 basic Linux newbie commands to identify the system
    ... > What about hyper-threading? ... I don't know anything about hyperthreading. ... How do I tell if my command above told me the machine under test is ... merely 4 times hyperthreaded or if the machine actually has 4 CPUs? ...
    (comp.os.linux.questions)