maxcpus
should be 4
and the complete option will look like maxcpus=4
This is an old revision of the document!
maxcpus
kernel option to half the amount of presented cores 1)sudo mkdir -p '/root/Scripts' && sudo -e '/root/Scripts/ht-off.sh' && sudo chmod +x '/root/Scripts/ht-off.sh'
#!/bin/bash for CPU in /sys/devices/system/cpu/cpu[0-7]*; 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,` if [ $CPUID = $THREAD1 ]; then echo "-> enable" [ -e $CPU/online ] && echo "1" > $CPU/online else echo "-> disable (HT core)" echo "0" > $CPU/online fi done lscpu | grep 'Thread(s) per core' lscpu | grep 'On-line CPU(s) list' lscpu | grep 'Off-line CPU(s) list'
su -c '/root/Scripts/ht-off.sh'
sudo -e '/etc/systemd/system/ht-off.service' && sudo systemctl daemon-reload && sudo systemctl enable 'ht-off' --now && sudo systemctl status 'ht-off' -l
[Unit] Description=Intel Hyper-Threading Disable After=basic.target Wants=basic.target [Service] Type=oneshot ExecStart='/bin/bash' -c '/root/Scripts/ht-off.sh' [Install] WantedBy=basic.target
sudo mkdir -p '/root/Scripts' && sudo -e '/root/Scripts/ht-on.sh' && sudo chmod +x '/root/Scripts/ht-on.sh'
#!/bin/bash for CPU in /sys/devices/system/cpu/cpu[0-7]*; 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,` if [ $CPUID = $THREAD1 ]; then echo "-> enable" [ -e $CPU/online ] && echo "1" > $CPU/online else echo "-> enable (HT core)" echo "1" > $CPU/online fi done lscpu | grep 'Thread(s) per core' lscpu | grep 'On-line CPU(s) list' lscpu | grep 'Off-line CPU(s) list'
su -c '/root/Scripts/ht-on.sh'
maxcpus
should be 4
and the complete option will look like maxcpus=4