Jeff Gilchrist wrote:

On Mon, 07 Mar 2005 22:51:53 +0000, Jesse Scott
<[EMAIL PROTECTED]> wrote:


Could hyperthreading be turned on for these machines? You will see better
iteration times with hyperthreading turned off.

Why is this true?


You don't get something for nothing.  In order to use hyperthreading
there is an overhead cost to manage the multiple threads on the
processor.  If you are not using software that is optimized for
hyperthreading then it is likely that it will run slower than if HT is
disabled.

The effect of HT can be a surprise if the stuff behind is not known. I also don't know every detail of HT, but I hope, I can help a bit here.


Some important points have already been said:
- HT shares resources (1 CPU) between 2 threads
- HT causes some overhead (but this is really small compared to CPU load caused by the apps)


Now some important things to understand the described behaviour:
HT can be seen like a way to multitask between 2 threads with instruction level granularity. We can see it like having one (non-HT) pipeline with some bubbles. Often there are no available instructions to fill the holes - because the code doesn't allow to execute them earlier or they have to wait for data or their destinated execution unit is already occupied for the available slot. Mispredicted branches add some more bubbles. Filling these pipeline bubbles with instructions from another thread is fine to increase efficiency.


But now the problem for certain apps is:
- the priority for both threads is actually about the same
- HT means, there is in most (or 100%?) cases a second thread running if your app provides one thread for the CPU
- ressource sharing means sharing of caches and the FSB


Without HT there would only be one thread get full access to the CPU (although with some more pipeline bubbles) including the caches and FSB. No other thread during that small timeframe is throwing data out of the cache or occupying the FSB. On such a system Prime95 might get 98% of CPU time, which translates to nearly 98% undisturbed work.

With HT Prime95 would at least share the CPU with the idle task and thus lose at least some performance because that other task is sitting in the cache and also occupying some execution units (mostly the - for Prime95 - less important integer units).

>
> I see the same thing in my parallel data compression code.  On a
> dual-processor machine with HT turned on (so 2 physical and 2 virtual
> CPUs), the software runs more slowly.  When I turn it off, I see quite
> a speed boost.
>

So you are providing 2 threads to each physical CPU. Since both threads work on their working set, fill the cache and cause data to be thrown out of the cache, they will negatively affect eachother more than e.g. Prime95 and the idle task. Also the usage of the integer units could have some effect.

Regards,
Matthias
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime

Reply via email to