Comments on: A Guide to Quickly Enable and Disable SMT and Hyper-Threading on Ubuntu and Debian https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/ Server and Workstation Reviews Thu, 14 Nov 2024 19:46:41 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: Evan Richardson https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-590779 Thu, 14 Nov 2024 19:46:41 +0000 https://www.servethehome.com/?p=81180#comment-590779 ” If you need to turn SMT or on Intel”

should probably be “if you need to turn SMT on or off on Intel…

]]>
By: Kyle https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-586653 Tue, 24 Sep 2024 05:55:09 +0000 https://www.servethehome.com/?p=81180#comment-586653 @Rob
Yes, it can be done this way as well, but it’s still not recommended, and should be considered a temporary solution until properly doing it in firmware.
Even on the site you linked it’s warned against: “Red Hat strongly recommends against enabling or disabling SMT at runtime.”.
There are good reasons for that. Most software isn’t routinely tested in a variable CPU count environment and can break in unusual ways when you yank CPUs from the system. Not every system is properly configured for hot-adding CPUs, be it real or SMT, either since there are actions required to restore optimal performance.

]]>
By: Solomon https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-586635 Mon, 23 Sep 2024 18:16:41 +0000 https://www.servethehome.com/?p=81180#comment-586635 This method offlines the SMT threads which works. We use it. On big systems it can take minutes though, but that’s usually faster than booting. It’s also useful if you want to run a live setup that you’re wanting to test b2b in scripts.

]]>
By: Rob https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-586632 Mon, 23 Sep 2024 17:06:49 +0000 https://www.servethehome.com/?p=81180#comment-586632 More interestingly is that SMT can be enabled / disabled on a per core basis using hotplugging, which ought to avoid the problem with re-enabling SMT: https://access.redhat.com/solutions/rhel-smt

]]>
By: Kyle https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-586625 Mon, 23 Sep 2024 15:11:55 +0000 https://www.servethehome.com/?p=81180#comment-586625 @fuzzyfuzzyfungus
Moving user processes is not a problem, but SMT threads can also host kernel processes which do have higher latencies of migration since they rarely get migrated in the first place.
Especially if those kernel threads are currently processing uninterruptible tasks and/or handling physical IOs. The interrupt controllers also have to be re-programmed to point vectors to the new CPUs, and on very busy systems it’s not done quickly.

@Nikolay Mihaylov
Yes, runtime SMT/HT control should only be the last resort. It’s better to use the kernel command-line “nosmt” to disable it at the CPU initialization time on boot. The best method is via firmware (BIOS Setup).

The article should also mention that re-enabling SMT after it’s been disabled at runtime/kernel parameter is not recommended by the kernel developers. In fact disabling at runtime should be done with “forceoff” instead of “off” to block future “on” attempts.

]]>
By: Nikolay Mihaylov https://www.servethehome.com/a-guide-to-quickly-enable-and-disable-smt-and-hyper-threading-on-ubuntu-and-debian/#comment-586624 Mon, 23 Sep 2024 14:42:35 +0000 https://www.servethehome.com/?p=81180#comment-586624 I wonder if there is any difference compared to switching it off in BIOS? There might be some CPU resources that are statically partitioned, especially on older CPUs. So turning SMT off is not the same as having it on but not scheduling anything on the adjacent threads.

]]>