How to verify list of "isolated" and "nohz_full" CPU information from sysfs?
Environment
- Red Hat Enterprise Linux 7.2 and higher(kernel-3.10.0-327.el7.x86_64 and higher)
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
Issue
- How to verify list of "isolated" and "nohz_full" CPU information from sysfs?
Resolution
- From RHEL 7.2 onwards (kernel-3.10.0-327.el7.x86_64 and higher), the
isolatedCPUs andnohz_fullCPU information can be verified from sysfs. The information is exported under following files.
/sys/devices/system/cpu/isolated
/sys/devices/system/cpu/nohz_full
- If
isolcpusis used withmanaged_irqornohzflag, then make sure to usedomainflag to Isolate from the general SMP balancing and scheduling algorithms. Ifisolcpusis used only withmanaged_irqornohzflag and cpu-list, then/sys/devices/system/cpu/isolatedfile shows blank output.
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-513.9.1.el8_9.x86_64 root=/dev/mapper/rhel_dhcp182--241-root ro crashkernel=auto resume=/dev/mapper/rhel_dhcp182--241-swap rd.lvm.lv=rhel_dhcp182-241/root rd.lvm.lv=rhel_dhcp182-241/swap isolcpus=nohz,2-7,10-15,18-23
# cat /sys/devices/system/cpu/isolated
<null>
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-513.9.1.el8_9.x86_64 root=/dev/mapper/rhel_dhcp182--241-root ro crashkernel=auto resume=/dev/mapper/rhel_dhcp182--241-swap rd.lvm.lv=rhel_dhcp182-241/root rd.lvm.lv=rhel_dhcp182-241/swap isolcpus=nohz,domain,2-7,10-15,18-23
# cat /sys/devices/system/cpu/isolated
2-7,10-15,18-23
Root Cause
- This change was introduced with the help of following two patches.
drivers-base-show-nohz_full-cpus-in-sysfs
drivers-base-show-isolated-cpus-in-sysfs
Diagnostic Steps
- Verification of CPU isolation from sysfs.
# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-320.el7.x86_64 root=/dev/mapper/rhel-root ro crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS1,115200n81 isolcpus=1,5-8 nohz_full=2,7-10
# cat /sys/devices/system/cpu/isolated
1,5-8
# cat /sys/devices/system/cpu/nohz_full
2,7-10
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments