4

Is there any performance difference between these disabled HyperThread scenarios? Which is the best, and why?

  • Disable HT in BIOS
  • Use noht kernel parameter

The high-optimized parallel applications works slower with enabled HT.
https://www.percona.com/blog/2015/01/15/hyper-threading-double-cpu-throughput/
Our app runs 13% faster on 4 cores than 4 cores + 4 HT.

The hardware:

  • Board: Supermicro X9SPU-F
  • CPU: Intel(R) Xeon(R) CPU E3-1275 V2
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
andras.tim
  • 159
  • 1
  • 6
  • That's rather an unexpected result. One common mistake is, when turning on HT, to schedule the job for e.g. 4 cores instead of 8. Make sure you don't fall into this trap. – Michael Hampton Oct 15 '16 at 02:13
  • @MichaelHampton If I use 4 threads only, the kernel will schedule on all cores these 4 jobs. In other hand, this will happening in non-laboratory conditions (e.g. 16 threads) too, so I think the thread limitation is not a good solution. – andras.tim Oct 17 '16 at 11:52
  • If you have 8 CPU threads and you schedule 16 threads of work, you will certainly see reduced performance! – Michael Hampton Oct 17 '16 at 13:10
  • To clarify, optimized codes often use instructions (like the AVX family) which have only one pipeline available per core. When the processes are blocking on these instructions, you'll see a performance hit. See https://stackoverflow.com/questions/30330013/does-hyperthreading-have-trouble-with-avx – Paul Jan 23 '18 at 23:00

1 Answers1

7

Well, the first obvious difference is that noht doesn't actually do anything on modern Linux systems. This kernel boot option is long obsolete, and was replaced with maxcpus=.

Setting maxcpus=m, where m is the number of physical (non-HT) cores, now accomplishes the same thing.

It's also possible to enable or disable individual CPU cores/hyperthreads via sysfs while the system is running.

With that out of the way...

There should be no difference in performance between disabling hyperthreading in the BIOS or disabling it in the operating system.

The only real difference is, if you disable the cores/threads in the OS, then you can re-enable them again later without rebooting. You might want to do this if you run different compute jobs, some of which benefit from hyperthreading and some of which do not.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940