Requires a Kernel with CONFIG_HOTPLUG_CPU
to be enabled (enabled by default in Arch):
# check online status cat /sys/devices/system/cpu/online # turn cpu1 on echo 1 > /sys/devices/system/cpu/cpu1/online # turn cpu1 off echo 0 > /sys/devices/system/cpu/cpu1/online
Clear swap. This is useful after a weekend where lots of stuff has been swapped out making everything laggy as it gets swapped back in:
sudo sync; sudo swapoff -a; sudo swapon -a