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

11/30/2021
by   Antonio Paolillo, et al.
0

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. 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/20/2018

Bridging the Gap Between Programming Languages and Hardware Weak Memory Models

We develop a new intermediate weak memory model, IMM, as a way of modula...
research
02/14/2018

A sound and complete definition of linearizability on weak memory models

Linearizability is the standard correctness notion for concurrent object...
research
04/17/2020

Defining and Verifying Durable Opacity: Correctness for Persistent Software Transactional Memory

Non-volatile memory (NVM), aka persistent memory, is a new paradigm for ...
research
02/12/2021

VSync: Push-Button Verification and Optimization for Synchronization Primitives on Weak Memory Models (Technical Report)

This technical report contains material accompanying our work with same ...
research
02/06/2018

Causal Linearizability: Compositionality for Partially Ordered Executions

In the interleaving model of concurrency, where events are totally order...
research
10/13/2017

The Semantics of Transactions and Weak Memory in x86, Power, ARM, and C++

Weak memory models provide a complex, system-centric semantics for concu...
research
11/15/2019

Reconciling Event Structures with Modern Multiprocessors

Weakestmo is a recently proposed memory consistency model that uses even...

Please sign up or login with your details

Forgot password? Click here to reset