NGnius / PowerTools

Moved to
https://git.ngni.us/NG-SD-Plugins/PowerTools
GNU General Public License v3.0
414 stars 29 forks source link

Investigate use of SMT setting file #48

Closed NGnius closed 1 year ago

NGnius commented 1 year ago

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/.

Originally mentioned here https://github.com/ValveSoftware/SteamOS/issues/864#issuecomment-1263493809 (Aside: Valve please make this project obsolete)

NGnius commented 1 year ago

This is mostly implemented. Pastaq pointed out that it's not all hooked up, so I'm going to leave this open while waiting for that change