CPU_EQUAL - Linux


Overview

CPU_EQUAL enables the alignment of the memory page size and CPU cache line size, optimizing memory access performance for specific workloads. This command is particularly valuable in high-performance computing (HPC) environments and applications that heavily rely on memory bandwidth.

Syntax

CPU_EQUAL [--enable] [--disable] [--status]

Options/Flags

  • –enable: Activates alignment of page size and cache line size.
  • –disable: Deactivates alignment, reverting to the default system configuration.
  • –status: Displays the current alignment status.

Examples

Enable alignment:

CPU_EQUAL --enable

Disable alignment:

CPU_EQUAL --disable

Check status:

CPU_EQUAL --status

Common Issues

  • Alignment may fail if the page size is not a multiple of the cache line size. To resolve this, adjust the page size using the hugepages kernel module.
  • Some workloads may not benefit from alignment. Monitoring performance before and after enabling alignment is recommended.

Integration

CPU_EQUAL can be integrated into system scripts to automate alignment adjustments:

if CPU_EQUAL --status | grep "Enabled"; then
  echo "Alignment already enabled"
else
  CPU_EQUAL --enable
fi

Related Commands

  • taskset: Binds processes to specific CPUs or cores.
  • numactl: Controls memory allocation on NUMA (Non-Uniform Memory Access) systems.
  • HugeTLB: Provides access to large pages for improved memory bandwidth.