Verifying and Optimizing Compact NUMA-Aware Locks on Weak Memory Models

Antonio Paolillo, Hernán Ponce-de-León, Thomas Haas, Diogo Behrens, Rafael Chehab +2 more
11/30/2021
cs.OS

Official code: huawei-drc/cna-verification (2 stars, C, last commit 2026-04-15).

Abstract

Developing concurrent software is challenging, especially if it has to run on modern architectures with Weak Memory Models (WMMs) such as ARMv8, Power, or RISC-V. For the sake of performance, WMMs allow hardware and compilers to aggressively reorder memory accesses.

Show full abstract

To guarantee correctness, developers have to carefully place memory barriers in the code to enforce ordering among critical memory operations. While WMM architectures are growing in popularity, identifying the necessary and sufficient barriers of complex synchronization primitives is notoriously difficult. Unfortunately, publications often consider barriers to be just implementation details and omit them. In this technical note, we report our efforts in verifying the correctness of the Compact NUMA-Aware (CNA) lock algorithm on WMMs. The CNA lock is of special interest because it has been proposed as a new slowpath for Linux qspinlock, the main spinlock in Linux. Besides determining a correct and efficient set of barriers for the original CNA algorithm on WMMs, we investigate the correctness of Linux qspinlock and the latest Linux CNA patch (v15) on the memory models LKMM, ARMv8, and Power. Surprisingly, we have found that Linux qspinlock and, consequently, Linux CNA are incorrect according to LKMM, but are still correct when compiled to ARMv8 or Power.

View on arXivView PDF

Code Implementations(1)

Verification of Linux CNA on WMM

20C, ShellDec 10, 20217 months ago

Similar Papers

Cite this paper

@article{paolillo2021verifying,
  title  = {Verifying and Optimizing Compact NUMA-Aware Locks on Weak Memory Models},
  author = {Antonio Paolillo and Hernán Ponce-de-León and Thomas Haas and Diogo Behrens and Rafael Chehab and Ming Fu and Roland Meyer},
  year   = {2021},
  eprint = {2111.15240},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.15240}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2111.15240.svg)](https://codeofpaper.com/paper/2111.15240)

Discussion