5

Here is an explanation of Hyper-Threading found on Wikipedia:

For each processor core that is physically present, the operating system addresses two virtual (logical) cores and shares the workload between them when possible.

I'm wondering why we don't have Hyper-Threading that provide 3 or 4 logical cores per physical core?

4

The manual Intel Hyper-Threading Technology Technical User’s Guide contains some hints about why Intel did not try for more than two threads per core in its consumer CPUs, which it did do in some server CPUs.

When explaining Hyper-Threading Technology, it says :

Each logical processor

  • Has its own architecture state
  • Executes its own code stream concurrently
  • Can be interrupted and halted independently

The two logical processors share the same

  • Execution engine and the caches
  • Firmware and system bus interface

The important part is that the two logical processors share the same Execution engine, meaning that the units that make up the core are not duplicated. Once, for example, the arithmetic unit is used by one thread, it cannot be used by the other thread. This prevents total parallelism, so does not allow two threads to execute in parallel instructions of the same type - one has to wait for the other to finish.

Intel has quantified the average performance gain by threads as follows:

A processor with Hyper-Threading Technology may provide a performance gain of 30 percent when executing multi-threaded operating system and application code over that of a comparable Intel architecture processor without Hyper-Threading Technology.

The statistical gain of two threads versus one is therefore only in the order of 30%, which is very far from the 100% that one would expect if two threads on the same core could do double the work of one.

I would therefore estimate that if Intel would have of enabled, say, three threads on the core, the statistical gain would be much lower, maybe on the order of 10% or less.

Given the fact that some hardware needs to be duplicated per each thread, namely the architecture state and interrupt logic, the gain is probably not worth the cost that this additional hardware would add to the price of the core.

For effective Hyper-Threading, Intel would have had to increase the number of units of the same type inside each core. It has done just that in the Haswell microarchitecture which has 4 ports for load/stores, 4 for integer, and 2 for branch, so even two threads running identical integer workloads probably wouldn't introduce much contention. However, Intel has still kept to the model of two hyper-threads per core, I would guess probably in order to economize on the hardware needed to allow more hyper-threads, or maybe even also because modern operating systems cannot actually use efficiently such an architecture.

1

This discussion has been raised at ServerFault SE: How many CPUs should be utilised with Hyperthreading?

when does having two different threads cause one to run worse?

Although dependencies between instructions won't change, there is a new problem born - competition. These different threads compete over memory access, both in cache utilization and bandwidth, which is somewhat counterproductive.

The logical core can’t do much, but it does provide a little increased parallelism. It is far from being a real core. In fact, it offers approx 30% the performance of a real physical core.

Its purpose was simply to increase parallelism in a world dominated by I/O bound (non-CPU intensive) processes. When a CPU intensive (CPU bound) thread is switched to one of these cores, its performance will substantially degrade.

Now imagine a scenario such thread is tossed around multiple logical cores, this can subsequently degrade perfomance.

Source: When HyperThreading Hurts

0

I'm wondering why we don't have Hyper-Threading that provide 3 or 4 logical cores per physical core?

The reason would be that, Intel engineers engineered Intel Hyper-Threading Technology, to only process 2 threads per physical core when enabled.

Here is Intel's official description of this feature:

Intel Hyper-Threading Technology (Intel HT Technology) delivers two processing threads per physical core. Highly threaded applications can get more work done in parallel, completing tasks sooner.

enter image description here

Source: Intel® Core™ i7-4770 Processor - Click on the ? next to the list feature on the specification page of any Intel processor.

  • Thanks for the answer but I'm still wondering why didn't Intel engineered HT targeting 3 or 4 threads? – A.L Aug 10 '17 at 14:47
  • 1
    Because that's harder to do. Hyperthreading is, at it's most basic, allowing the parts of the core that are not currently being used for the main thread to process parts of the secondary thread. There are only so many sections in a core (no point having redundant components, better to create another core) The secondary thread is processed within the overhead of the first core, which is already less than the resources for the main thread. tldr: not enough room, better to make another core than make more room. – Baldrickk Aug 10 '17 at 14:54
  • @A.L - If you want to know the specific reason Intel's engineers designed this feature the way they did then i encourage you to contact Intel. The contacts I have that worked for Intel wouldn't be able to tell me the reason. – Ramhound Aug 10 '17 at 15:18
0

Why not 3 or 4 threads? Or 8? Diminishing returns. Sun did 8 threads per core and for things that need many threads but not high performance it worked well but you will notice that the clock speed was much lower that Intel chips of the same time. Duplicating parts of the core for more threads contributes to additional heat build up. The newer chips from Sun and now Oracle have the ability to dynamically turn off some or all other threads on a given core to provide high performance for a single threaded task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.