Verifying General-Purpose RCU for Reclamation in Relaxed Memory Separation Logic
Read-Copy-Update (RCU) is a critical synchronization mechanism for concurrent data structures,
enabling efficient deferred memory reclamation.
However, implementing and using RCU correctly is challenging due to its inherent concurrency complexities.
While previous work verified RCU,
they either relied on unrealistic assumptions of sequentially consistent (SC) memory model
or lacked three key features of general-purpose RCU libraries:
modular specification, switchable critical sections, and concurrent writer support.
We present the first formal verification of a general-purpose RCU in realistic \emph{relaxed memory consistency} (RMC),
addressing the challenges posed by these features.
To achieve modular specification that encompasses relaxed behaviors, we extend existing SC specifications to account for explicit synchronization.
To support switchable critical sections, which require read-after-write (RAW) synchronization, we introduce a reasoning principle for RAW-synchronizing SC fences.
Using this principle, we also present the first formal verification of Peterson's mutex in RMC.
To support concurrent writers performing partially ordered writes,
we avoid assuming a total order of links and instead formulate invariants based on per-node incoming link histories.
Our proofs are mechanized in the iRC11 relaxed memory separation logic, built upon Iris, in Rocq.