Skip to content

Instantly share code, notes, and snippets.

View syoh's full-sized avatar

Sang-Yun Oh syoh

  • University of California, Santa Barbara
  • Santa Barbara, CA, USA
View GitHub Profile
@samueljon
samueljon / toggleHT.sh
Last active November 5, 2024 10:00
Disable / Enable HyperThreading cores on runtime - linux
#!/bin/bash
HYPERTHREADING=1
function toggleHyperThreading() {
for CPU in /sys/devices/system/cpu/cpu[0-9]*; do
CPUID=`basename $CPU | cut -b4-`
echo -en "CPU: $CPUID\t"
[ -e $CPU/online ] && echo "1" > $CPU/online
THREAD1=`cat $CPU/topology/thread_siblings_list | cut -f1 -d,`