Describe what you'd like to be able to do
Investigate toggling SMT with the dedicated sysfs file /sys/devices/system/cpu/smt/control instead of (or in conjunction with) disabling every second thread.
Describe alternatives you've considered
The current implementation works, but if there's a less janky way I'd prefer that.
Additional context
The file /sys/devices/system/cpu/smt/control is rw with root and seems to accept on or off(?) as input to set SMT mode. There's also /sys/devices/system/cpu/smt/active which is ro but is an integer/bool (0 is off, 1 is on) which can be used to determine the SMT status. I don't know how this affects cpu# listings in /sys/devices/system/cpu/.
Describe what you'd like to be able to do Investigate toggling SMT with the dedicated sysfs file
/sys/devices/system/cpu/smt/control
instead of (or in conjunction with) disabling every second thread.Describe alternatives you've considered The current implementation works, but if there's a less janky way I'd prefer that.
Additional context The file
/sys/devices/system/cpu/smt/control
is rw with root and seems to accepton
oroff
(?) as input to set SMT mode. There's also/sys/devices/system/cpu/smt/active
which is ro but is an integer/bool (0 is off, 1 is on) which can be used to determine the SMT status. I don't know how this affects cpu# listings in/sys/devices/system/cpu/
.Originally mentioned here https://github.com/ValveSoftware/SteamOS/issues/864#issuecomment-1263493809 (Aside: Valve please make this project obsolete)