# Hyper-Threading... Hype?

## greenhorn

Hi,

I'm the brand new owner of a P4 2.6Ghz HT enabled processor. It just replaced my 2.4GHz I had in before (nevermind the "small" upgrade, I managed to get it for free and now I'm finally using the 800MHz bus)... But what about the Hyper Threading support?

I read a few things about it and it seems it works quite faster... for a few stuff and a bit slower for much more stuff!

see http://www-106.ibm.com/developerworks/linux/library/l-htl/

It actually took me 2 kernel recompile before I got the 2 cpu's into my /proc/cpuinfo as if I used a real SMP system.

My point (1) and question (2)  are:

1°/ Is this HT really usefull? Did some of you really experienced any enhancements?

2°/ Why can't I get the nVidia kernel module to load? it complains about missing _SMP links, as if I had a nonSMP kernel running (SMP enabled, aswell as ACPI with the CPU Enumeration Only, to get the 2 "pseudo-processors" reconized)

I post this mainly because of point 1, cause if HT turns out to be only hype, I don't care about point 2! My system is running just fine with a 2.6GHz CPU 800MHz FSB... And two kernel compiles are getting a bit too close to "too much" for maybe only... nothing!

Thanks

please flam here!

----------

## Redson

I remember looking at some benchmarks on kerneltrap that showed hyperthreading to be a minor performance increase for the 2.4 series of kernel's, but a much larger performance difference (>30% increase in heavily threaded applications).

Please note that all of this is off the top of my head, but you might want to check out the 2.6 test kernel

Take care

----------

## greenhorn

Well there comes the question :

"What is to be considered as heavily threaded applications"?

Because if this only for high load server applications... again I guess we mortals don't have to care too much... Or is qt(-mt) to based apps or java-based netbeans a heavily threaded application?

But I guess I'll go for the second advise

 *Quote:*   

> but you might want to check out the 2.6 test kernel 

 

 I guess I'll wait for 2.6 to come out, before I use that HT

Thanks

----------

## kormoc

DeletedLast edited by kormoc on Mon Dec 24, 2018 9:21 am; edited 1 time in total

----------

## syamajala

I have a dual xeon system that is hyper threading enabled but I haven't gotten it to work with linux so far. I found no performance boost with it in windows so i thought mabey i should try it in linux.

----------

## TenPin

AFAIK the idea of Hyper Threading is that the P4 has so many pipelines (and 2 ALUs) that the ones that sit around doing nothing might aswell be used on another thread. So you will only get a noticable performance benefit with certain types of CPU usage. There should be benchmarks out there somewhere, I would be interested to see the comparisons for compiling the kernel with various -j options.

----------

## fishhead

HyperThreading runs two programs simultainiously. There's a nice article at arstechnica on this. In one respect, HT on the P4 helps alot because of the 20 cycle penalty for branch mispredictions (ugh!) that P4s suffer - one thread can keep going. On the other hand both processes share L1 and L2 Cache. With the P4's already pitifuly small L1 cache, I think this is a horible idea - especialy since a trip to L2 cache is almost as expensive as a branch mispredict. 

That being said, I don't have any P4s, only athlons .....

----------

## TenPin

Yeah, it does sound horrible, I guess its just a  way to squeeze a little more performance out of a horrible design and at the same time have this fantastic gimmick with a fancy name that customers won't understand but will go Oooooh yours doesn't have HT so it must suck.

Intel also mention that the performance increase can depend on the compiler alot so maybe there will be more benefits with later GCCs or with ICC.

----------

## miseiler

The only "real" performance difference should show when compiling...be sure the -j2 or better yet, -j3 options are selected in your make.conf.  It should boost compile speed significantly.

----------

## x20vmk4x

im going to try to enable it now, and i did a time make on 2.6.0-test3 with these results:

real    8m14.154s

user    6m15.150s

sys     0m27.545s

in a minute ill compile it again in the HT-eneabled kernel.

----------

## barlad

I did no benchmark but compiling with j3 on my HT processor gave me  a quite decent performance boost. Compiling is the only thing that seems to go faster though.

----------

## KeithReuters

P4 HT 2.4 - Kernel compilation

with HT : make -j3  bzImage ---> 188 seconds

without HT : make -j3 bzImage ---> 240 seconds.

The computer runs more smoothly when running multiple applications. the boost is even more noticeable with 2.6-test.

Pascal.

----------

## fishhead

I guess the real point here if you're thinking about running HT is that you might see some speedup with mulltiple tasks or threads, but at the expense of some single tasks. As I mentioned before, this page gives hyperthreading a good going over.

----------

## SpinDizzy

 *KeithReuters wrote:*   

> P4 HT 2.4 - Kernel compilation
> 
> without HT : make -j3 bzImage ---> 240 seconds.
> 
> Pascal.

 

You shouldn't use -j3 when compiling on a single CPU (without HT (or distcc)) as it will cause a loss due to task-switching.

This skews your results in favor of the HT.

----------

## xavior2180

i have a p4 2.4ghz gentoo box.  i noticed that the gentoo kernel doesn't seem to be able to handle the HT capability, however, with the 2.6-test4 kernel, i've noticed not so much a increase in speed, but when i do things like, compile, it doesn't slow other things down.  with HT, i am able to run 2 threads of SETI and both "processors" run it at 100%, making it essentially 200%, on a single processor.  On top of that, when i compile, it will use 100% of one "processor" for compiling, and 100% of the other for SETI, or whatever else.  Out of curiosity, i was able to compile a kernel, and play mp3s with xmms, and run the JESS visualization plugin, without experiencing any lag at all, as if i wasn't doing anything at all.

I know some people that have this misconception that HT's purpose is to increase speed or performance, however, that is not entirely the case. all it is designed to do, is emulate multiple processors.  There would not be a significant increase in speed even when using two physical processors, but an increase in the ability to multitask, which is what HT does a very fine job of, from what i've seen, at least on an OS that can support it.

I have noticed a DECREASE in speed alone when using the gentoo kernel with it enabled, however, the gentoo kernel doesn't seem to support HTing, as it only shows one processor.  I have not seen any decreased performance in individual applications however, with HT working.

just my 2 cents.

----------

## 5a\/ag3

am I not correct in saying when you use the  -j [number] you are then specifying the number of jobs for that specific thread?

there was a big discussion on this at 2cpu on why just using a make -j would crash your system.

you will notice that teyting different number by the -j you will get a *SWEET* spot for your system.

----------

## TwinGears

I would like to know after the Live CD booting and the like you actually get to the kernel part. Are any of you saying that one must make the kernel by hand to get this HT to happen or just how does one go about changing the installing procedure to get to where we are all trying to get to.

Pardon my ignorance but I feel when I come to tackle this problem for real someone out their might actually save me time. After all the Gentoo forms are the best I have seen on the WWW.

thanks

 :Smile: 

----------

## 5a\/ag3

when using a system that has one or more threads ie Hyperthreading or dual CPU systems you need to enable the smp kernel smp = Symmetric Multi-processing, a thread is a thread is a thread, just make sure that your kernel is later than 2.4-18

at your boot screen you type in "smp" instead of hitting enter for default kernel

----------

