Skip to content

Instantly share code, notes, and snippets.

@annulen
Last active October 1, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annulen/07b5b153a06c578ef2ca3b9ed2bd84f3 to your computer and use it in GitHub Desktop.
Save annulen/07b5b153a06c578ef2ca3b9ed2bd84f3 to your computer and use it in GitHub Desktop.
How to disable hyper-threading with only SSH access
#!/bin/sh
cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list
#!/bin/sh
echo 0 > /sys/devices/system/cpu/cpu4/online
echo 0 > /sys/devices/system/cpu/cpu5/online
echo 0 > /sys/devices/system/cpu/cpu6/online
echo 0 > /sys/devices/system/cpu/cpu7/online
#!/bin/sh
echo 1 > /sys/devices/system/cpu/cpu4/online
echo 1 > /sys/devices/system/cpu/cpu5/online
echo 1 > /sys/devices/system/cpu/cpu6/online
echo 1 > /sys/devices/system/cpu/cpu7/online
Note that it's probably a bad idea to do this; I've resorted to this evil because of suspicion about CPU being defective or physically damaged.
./cpu_topology.sh - lists what virtual cores correspond to the same physical core
You need to adjust other scripts according to ./cpu_topology.sh results, they are given for typical 4 cores with HT case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment