lscpu | grep "Off-line"
echo 1 > /sys/devices/system/cpu/cpu9/online
OFF_CPUS=$(lscpu | grep "Off-line" | awk '{print $NF}' | tr '-' ' ')
for i in $(seq $OFF_CPUS);do echo 1 > /sys/devices/system/cpu/cpu$i/online;done
查看生效
lscpu
2024-07-16 673 0
lscpu | grep "Off-line"
echo 1 > /sys/devices/system/cpu/cpu9/online
OFF_CPUS=$(lscpu | grep "Off-line" | awk '{print $NF}' | tr '-' ' ')
for i in $(seq $OFF_CPUS);do echo 1 > /sys/devices/system/cpu/cpu$i/online;done
查看生效
lscpu