CPUs online or offline
Jump to navigation
Jump to search
Check CPU status
# get the list of offline CPUs
cat /sys/devices/system/cpu/offline
cat /sys/devices/system/cpu/online
# get the list of online CPUs
# get the list of CPUs
ls -ld /sys/devices/system/cpu/cpu*
# print individual CPU's online/offline status
cat /sys/devices/system/cpu/cpu*/online
# set online CPU <number>
echo 1 > /sys/devices/system/cpu/cpu<number>/online
or
sudo chcpu -e <number>
# set offline CPU <number>
echo 0 > /sys/devices/system/cpu/cpu<number>/online
or
sudo chcpu -d <number>
smpboot: native_cpu_up: bad cpu 255
This thread[1] shows system IOMMU enable in BIOS would be required to enable the last CPU core on Gigabyte system. However, it would be also related to other systems' BIOS configuration.
We can enable or disable the x2APIC architecture from the BIOS Setup cause x2APIC requires that the IOMMU be enabled and that IRQ remapping is enabled.
This thread shows a general steps to enable x2APIC in BIOS,
- Enable IOMMU in the BIOS. (It's disabled by default on many systems. Even on my brand new (July 2020) Gigabyte R282-Z93 with EPYC 7742 CPUs!)
- Enable x2APIC in the BIOS.
- Enable IOMMU support in the kernel:
- For Intel CPUs:
CONFIG_INTEL_IOMMU=y
- For AMD CPUs:
CONFIG_AMD_IOMMU=y
andCONFIG_AMD_IOMMU_V2=y
- For Intel CPUs:
- Enable x2APIC support in the kernel:
CONFIG_X86_X2APIC=y
- Enable IRQ remapping in the kernel:
CONFIG_IRQ_REMAP=y
However, x2APIC is also dependingn on the type/version of OS,
- Windows Server 2016
- Windows Server 2016 supports AMD EPYC 7xx2-series CPUs, but this O.S. is limited to no more than 255 logical processors. Windows Server 2016 does not support X2APIC mode, and you should disable this mode in BIOS.
- AMD CBS-> CPU Common Options-> Performance-> CCD/Core/Thread Enablement ->Accept-> SMT control->Disabled (For ASUS BIOS)
- On Linux
- Following kernel boot parameter can prevent enabling of the x2APIC mode
- intremap=no_x2apic_optout nox2apic
- Following kernel boot parameter can prevent enabling of the x2APIC mode