BIOS/SMT Control: Difference between revisions
No edit summary  | 
				|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Simultaneous Multithreading ==  | |||
Simultaneous Multithreading (SMT) allows multiple execution threads to be executed on a single physical CPU core. The technology is known by a number of different names, such as Hyper-Threading, but operate along similar principles.  | |||
Intel provides an excellent overview for Hyper-Threading (HT), an implementation of SMT, and when it may or may not be helpful, depending on the application.  | |||
== Verifying a Systems Hyper-Thread Topology ==  | |||
Each Hyper-Thread for a system will appear to the kernel as a logical CPU core<syntaxhighlight lang="bash">  | |||
$ lscpu | grep -e Socket -e Core -e Thread  | |||
Thread(s) per core:                 2  | |||
Core(s) per socket:                 16  | |||
Socket(s):                          1  | |||
Model name:                         AMD EPYC 7282 16-Core Processor  | |||
</syntaxhighlight>  | |||
== Control SMT <ref>https://access.redhat.com/solutions/rhel-smt</ref> ==  | |||
/sys/devices/system/cpu/smt/control:  | |||
     This file allows to read out the SMT control state and provides the ability to disable or (re)enable SMT. The possible states are:  | |||
/sys/devices/system/cpu/smt/active:  | |||
     This file reports whether SMT is enabled and active, i.e. if on any physical core two or more sibling threads are online.  | |||
{| class="wikitable"  | |||
|+  | |||
!States  | |||
!Description   | |||
|-  | |||
|on  | |||
|SMT is supported by the CPU and enabled. All logical CPUs can be onlined and offlined without restrictions  | |||
|-  | |||
|off  | |||
|SMT is supported by the CPU and disabled. Only the so called primary SMT threads can be onlined and offlined without restrictions. An attempt to online a non-primary sibling is rejected  | |||
|-  | |||
|forceoff  | |||
|Same as 'off' but the state cannot be controlled. Attempts to write to the control file are rejected  | |||
|-  | |||
|notsupported  | |||
|The processor does not [[support]] SMT. It's therefore not affected by the SMT implications of L1TF. Attempts to write to the control file are rejected  | |||
|}  | |||
<syntaxhighlight lang="bash">  | |||
To disable SMT during runtime, the following can be used:  | |||
# echo off > /sys/devices/system/cpu/smt/control  | |||
To enable SMT during runtime, the following can be used:  | |||
# echo on > /sys/devices/system/cpu/smt/control  | |||
Alternatively, the following one-liner script can be used to disable one Hyper-Thread of each CPU core on the system  | |||
for CPU in $( ls /sys/devices/system/cpu/cpu[0-9]* -d | sort); do   | |||
awk -F '[-,]' '{if(NF > 1) {HOTPLUG="/sys/devices/system/cpu/cpu"$NF"/online"; print "0" > HOTPLUG; close(HOTPLUG)}}' $CPU/topology/thread_siblings_list 2>/dev/null; done  | |||
</syntaxhighlight>  | |||
== AMD Simultaneous Multithreading (SMT)<ref>https://techlibrary.hpe.com/docs/iss/proliant-gen10-uefi/GUID-F2A21BDE-7240-4604-9238-27290ECE82A4.html</ref> ==  | |||
{{Notes|This option is available on servers with AMD processors}}  | {{Notes|This option is available on servers with AMD processors}}  | ||
{| class="wikitable"  | |||
!Value      | |||
!Description  | |||
!Notes  | |||
|-  | |||
|Enabled  | |||
|Each physical processor core operates as two logical processor cores. Enabling this option can improve overall performance for applications that benefit from a higher processor core count.  | |||
|  | |||
|-  | |||
|Disabled  | |||
|Each physical processor core operates as one logical processor core.  | |||
|  | |||
|}  | |||
== Typical BIOS menu path ==  | |||
Supermicro - CPU Configuration > SMT Control  | |||
== References ==  | == References ==  | ||
<references />  | <references />  | ||
Latest revision as of 12:48, 6 May 2024
Simultaneous Multithreading
Simultaneous Multithreading (SMT) allows multiple execution threads to be executed on a single physical CPU core. The technology is known by a number of different names, such as Hyper-Threading, but operate along similar principles.
Intel provides an excellent overview for Hyper-Threading (HT), an implementation of SMT, and when it may or may not be helpful, depending on the application.
Verifying a Systems Hyper-Thread Topology
Each Hyper-Thread for a system will appear to the kernel as a logical CPU core
$ lscpu | grep -e Socket -e Core -e Thread
Thread(s) per core:                 2
Core(s) per socket:                 16
Socket(s):                          1
Model name:                         AMD EPYC 7282 16-Core Processor
Control SMT [1]
/sys/devices/system/cpu/smt/control:
This file allows to read out the SMT control state and provides the ability to disable or (re)enable SMT. The possible states are:
/sys/devices/system/cpu/smt/active:
This file reports whether SMT is enabled and active, i.e. if on any physical core two or more sibling threads are online.
| States | Description | 
|---|---|
| on | SMT is supported by the CPU and enabled. All logical CPUs can be onlined and offlined without restrictions | 
| off | SMT is supported by the CPU and disabled. Only the so called primary SMT threads can be onlined and offlined without restrictions. An attempt to online a non-primary sibling is rejected | 
| forceoff | Same as 'off' but the state cannot be controlled. Attempts to write to the control file are rejected | 
| notsupported | The processor does not support SMT. It's therefore not affected by the SMT implications of L1TF. Attempts to write to the control file are rejected | 
To disable SMT during runtime, the following can be used:
# echo off > /sys/devices/system/cpu/smt/control
To enable SMT during runtime, the following can be used:
# echo on > /sys/devices/system/cpu/smt/control
Alternatively, the following one-liner script can be used to disable one Hyper-Thread of each CPU core on the system
for CPU in $( ls /sys/devices/system/cpu/cpu[0-9]* -d | sort); do 
awk -F '[-,]' '{if(NF > 1) {HOTPLUG="/sys/devices/system/cpu/cpu"$NF"/online"; print "0" > HOTPLUG; close(HOTPLUG)}}' $CPU/topology/thread_siblings_list 2>/dev/null; done
AMD Simultaneous Multithreading (SMT)[2]
     
 Note:  This option is available on servers with AMD processors
| Value | Description | Notes | 
|---|---|---|
| Enabled | Each physical processor core operates as two logical processor cores. Enabling this option can improve overall performance for applications that benefit from a higher processor core count. | |
| Disabled | Each physical processor core operates as one logical processor core. | 
Supermicro - CPU Configuration > SMT Control