News for hackers. Stuff that matters.
Re:It's all about the cores. Why AMD doesn't use HyperThreading by ars on Thursday January 21, 2010 @05:59PM (#1068605)
And those examples are terrible.

This first example says "unstable" which is clearly false, so we can ignore him as ignorant.

The second two are both on windows, which until windows 7 was unable to schedule hyperthreading correctly.

The last example with linpack you are maxing out the core, so obviously hyperthreading won't help. Hyperthreading helps when you are not maxing out the core on any one task. Although a drop is not great, for regular desktop apps I think you'll have an overall net gain.

The OS task scheduler can switch tasks if one stalls for IO. A CPU based task scheduler can task switch on cache miss, or availability of single pieces of a CPU (like an adder).

Next he'll say not to run a multi tasking OS. Instead run each task on it's own CPU - "and don't worry we are making more CPUs soon".

Re:It's all about the cores. Why AMD doesn't use HyperThreading by andreyf on Thursday January 21, 2010 @06:21PM (#1068649)
Could you link to further reading about how a CPU-based scheduler works? The wikipedia article [1] only mentions OS-level scheduling, and I was always under the impression that the CPU knew nothing of threads or processes.

CPU based task scheduler can task switch on cache miss, or availability of single pieces of a CPU (like an adder).

Can't the CPU just signal an interrupt for those, and let the OS scheduler handle it?

1. http://en.wikipedia.org/wiki/Scheduling_(computing)

Re:It's all about the cores. Why AMD doesn't use HyperThreading by wmf on Thursday January 21, 2010 @06:35PM (#1068688)
Multithreaded processors have multiple hardware threads. An SMT processor schedules instructions, mostly ignoring which thread they come from. An SoEMT processor schedules hardware threads, usually switching on a cache miss or similar stall event.

http://en.wikipedia.org/wiki/Multithreading_(computer_hardwa...

Can't the CPU just signal an interrupt for those, and let the OS scheduler handle it?

This is usually not efficient because handling an interrupt takes nearly as long as a cache miss (and let us not consider the case where the interrupt handler itself triggers a cache miss), but Intel did a prototype on the Itanium that worked this way.

Re:It's all about the cores. Why AMD doesn't use HyperThreading by ars on Thursday January 21, 2010 @06:36PM (#1068693)
See http://en.wikipedia.org/wiki/Instruction_level_parallelism

A CPU scheduler (instruction unit) does not schedule threads or processes - instead it schedules instructions (assembly instructions).

A thread might block while waiting for IO (disk, net, user input, etc).

An instruction might block because it's waiting for the cache to load its data, or it might block because it does not have an available execution unit.

A modern CPU has, for example, 4 units that can add, 2 that can multiply, 1 for floating point, another for memory IO, another that does XOR, etc, etc.

If one of those is busy you try to find an instruction that can make use of an idle unit.

It's often hard to find an instruction because they often depend on each other, so you have to do them in order. With hyperthreading you have double the number of available instructions to choose from (and those two instruction streams are independent of each other).

The biggest problem with hyperthreading is the cache. Memory is very slow, so you cache memory locally, with hyperthreeading you have twice as much data to cache, so some data is evicted - this is bad.

Some tasks will be slower because of this, but most won't.

Re:It's all about the cores. Why AMD doesn't use HyperThreading by Confusion on Friday January 22, 2010 @01:56AM (#1069253)
The second two are both on windows, which until windows 7 was unable to schedule hyperthreading correctly.

Hyperthreading doesn't require any special OS support. As the wikipedia page states:

  This technology is transparent to operating systems and 
  programs. All that is required to take advantage of hyper- 
  threading is symmetric multiprocessing (SMP) support in
  the operating system, as the logical processors appear as
  standard separate processors.
Re:It's all about the cores. Why AMD doesn't use HyperThreading by neilc on Friday January 22, 2010 @02:54AM (#1069309)
No extensive OS support is required to utilize basic SMT, true -- but the scheduler needs to be aware of SMT to do remotely-intelligent scheduling. As a trivial example, if you have 2 runnable processes, 4 logical cores, and 2 physical cores, it obviously makes sense to schedule one process on each physical core. (In fact, the Wikipedia article says this, in the very next paragraph after the one you quoted.)
Re:It's all about the cores. Why AMD doesn't use HyperThreading by Confusion on Friday January 22, 2010 @03:57AM (#1069354)
True, but then the point the original article makes kicks in: that's a relatively poor way of doing things. Originally HT was supposed to be transparent. Then it turned out the abstraction wasn't quite as good as they hoped and OS level support was needed. That adds a lot of complexity and possibilities for mistakes. At that point, they should have dropped HT and go for actual cores instead.
Re:It's all about the cores. Why AMD doesn't use HyperThreading by neilc on Friday January 22, 2010 @11:24AM (#1069924)
Originally HT was supposed to be transparent.

According to whom? I don't think anyone with a clue would have suggested that. If you care about writing high-performance code, you care about the behavior of your processor. Obviously, multiplexing the execution of two program threads onto a single physical core is going to affect performance, whether in the form of scheduling differences, caching effects, etc.

they should have dropped HT and go for actual cores instead.

Well, you can do both, of course. If HT gets you better utilization of a single core, then fair enough. The question is really whether the transistors/power you burn on HT would be better spent on additional cores (or bigger caches, etc.).