Linux 7.0 Adds 64-Byte Atomic Instructions for ARM64
#Hardware

Linux 7.0 Adds 64-Byte Atomic Instructions for ARM64

Hardware Reporter
3 min read

The upcoming Linux 7.0 kernel introduces support for Armv8.7's 64-byte single-copy atomic instructions (LS64/LS64V), enabling faster direct workqueue entry operations and improving performance for high-throughput ARM workloads.

The Linux 7.0 kernel cycle brings a significant performance boost to ARM64 systems with the addition of support for Armv8.7's 64-byte single-copy atomic instructions. This feature, centered around the LS64 and LS64V instructions, represents a major step forward for ARM's capabilities in high-performance computing scenarios.

ARM

64-Byte Atomic Operations

Armv8.7 introduced single-copy atomic 64-byte load and store instructions, and Linux 7.0 now fully supports these operations. The new instructions are exposed to user-space through /proc/cpuinfo and hardware capabilities, making them readily available for applications that can benefit from this functionality.

The patch series notes that "Armv8.7 introduces single-copy atomic 64-byte loads and stores instructions and its variants named under FEAT_{LS64, LS64_V}." A practical application mentioned is in userspace drivers that can implement direct Work Queue Entry (WQE) mechanisms, allowing them to fill WQE directly into hardware with atomic guarantees.

This capability is particularly valuable for networking and storage workloads where large contiguous data blocks need to be moved atomically between user space and hardware. The 64-byte atomic operations eliminate the need for complex locking mechanisms or multiple smaller atomic operations, reducing overhead and improving throughput.

Virtualization Support

The LS64V variant, which provides vector operations for these atomic instructions, is also made available to Linux KVM guests. This means virtualized environments can take advantage of the same performance benefits, ensuring that ARM-based cloud and container workloads can leverage these instructions even when running in virtualized environments.

Memory Tagging Extension Improvements

Beyond the LS64/LS64V support, the ARM64 updates in Linux 7.0 include significant optimizations for Memory Tagging Extension (MTE) on AmpereOne processors. MTE, while providing valuable security benefits through memory corruption detection, previously introduced substantial performance overhead.

According to the developers, "We measured severe performance overhead (25-50%) when enabling userspace MTE and running memcached on an AmpereOne machine. We identified excessive tag checking taking place in the kernel."

With the Linux 7.0 improvements, workloads with MTE enabled show measurable performance gains. Testing with "perf bench futex hash" demonstrated a 2% improvement at 95% confidence. More notably, the Phoronix Test Suite's pts/memcached benchmark with a get-heavy workload (1:10 Set:Get ratio) showed significant improvements. The performance impact was particularly pronounced on systems with higher core counts, with slowdowns leveling out above 32 cores.

Security Updates

Linux 7.0 also addresses security concerns on HiSilicon TSV110 processors with a Spectre-BHB (Branch History Buffer) workaround. This mitigation helps protect against potential side-channel attacks that could exploit branch prediction mechanisms on these specific ARM processors.

Availability

All of these ARM64 updates have already been merged into the Linux 7.0 Git tree through the ARM64 pull request. As Linux 7.0 continues its development cycle, these features will undergo further testing and refinement before the final release.

The addition of 64-byte atomic instructions represents a significant milestone for ARM64 Linux, bringing it closer to parity with x86_64 systems in terms of atomic operation capabilities. For developers working on high-performance networking, storage, or other throughput-intensive applications on ARM platforms, these new instructions open up possibilities for more efficient and scalable implementations.

Twitter image

Comments

Loading comments...