scripts:hyper-threading
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
scripts:hyper-threading [2017/09/04 06:10] – [Information] Sean Rhone | scripts:hyper-threading [2021/06/18 02:33] (current) – removed Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Information ====== | ||
- | * Scripts to disable/ | ||
- | * Similar functionality can be achieved by setting the '' | ||
- | |||
- | ===== Credit ===== | ||
- | |||
- | * https:// | ||
- | |||
- | ====== Disable HT ====== | ||
- | |||
- | * This disables the virtual cores created by Hyper-threading and leaves the actual cores enabled | ||
- | |||
- | sudo mkdir -p '/ | ||
- | |||
- | < | ||
- | #!/bin/bash | ||
- | for CPU in / | ||
- | CPUID=`basename $CPU | cut -b4-` | ||
- | echo -en "CPU: $CPUID\t" | ||
- | [ -e $CPU/online ] && echo " | ||
- | THREAD1=`cat $CPU/ | ||
- | if [ $CPUID = $THREAD1 ]; then | ||
- | echo "-> enable" | ||
- | [ -e $CPU/online ] && echo " | ||
- | else | ||
- | echo "-> disable (HT core)" | ||
- | echo " | ||
- | fi | ||
- | done | ||
- | lscpu | grep ' | ||
- | lscpu | grep ' | ||
- | lscpu | grep ' | ||
- | |||
- | su -c '/ | ||
- | |||
- | ===== Service ===== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Unit] | ||
- | Description=Intel Hyper-Threading Disable | ||
- | After=basic.target | ||
- | Wants=basic.target | ||
- | |||
- | [Service] | ||
- | Type=oneshot | ||
- | ExecStart='/ | ||
- | |||
- | [Install] | ||
- | WantedBy=basic.target</ | ||
- | |||
- | ====== Enable HT ====== | ||
- | |||
- | * This re-enables disabled cores from the above script | ||
- | |||
- | sudo mkdir -p '/ | ||
- | |||
- | < | ||
- | #!/bin/bash | ||
- | for CPU in / | ||
- | CPUID=`basename $CPU | cut -b4-` | ||
- | echo -en "CPU: $CPUID\t" | ||
- | [ -e $CPU/online ] && echo " | ||
- | THREAD1=`cat $CPU/ | ||
- | if [ $CPUID = $THREAD1 ]; then | ||
- | echo "-> enable" | ||
- | [ -e $CPU/online ] && echo " | ||
- | else | ||
- | echo "-> enable (HT core)" | ||
- | echo " | ||
- | fi | ||
- | done | ||
- | lscpu | grep ' | ||
- | lscpu | grep ' | ||
- | lscpu | grep ' | ||
- | |||
- | su -c '/ |
/var/www/wiki/data/attic/scripts/hyper-threading.1504519812.txt.gz · Last modified: 2017/09/04 06:10 by Sean Rhone