AtoMig: Automatically Migrating Millions Lines of Code from TSO to WMM
Martin Beck, Koustubha Bhat, Lazar Stricevic, Geng Chen, Diogo Behrens, Ming Fu, Viktor Vafeiadis, Haibo Chen, Hermann Härtig
Abstract
CPUs with weak memory-consistency models (WMMs), such as Arm and RISC-V, are rapidly increasing their market share. Porting legacy x86 applications to such CPUs requires introducing extra synchronization to prevent WMM-related concurrency bugs-a task often left to human experts.
Given the rarity of such experts and the enormous size of legacy applications, we develop AtoMig, an effective, fully automated tool for porting large, real-world applications to WMM CPU architectures. AtoMig detects shared memory access patterns with novel static analysis strategies and performs program transformations to properly protect them from WMM effects. In the absence of sufficiently scalable verification methods, AtoMig shows practicality of focusing on code patterns more prone to WMM faults, trading off completeness for scalability.
We validate the correctness of AtoMig's transformations on several small concurrent benchmarks via model checking. We demonstrate the scalability and performance of our approach by applying AtoMig to popular real-world large code bases with up to millions of lines of code, viz., MariaDB, PostgreSQL, SQLite, LevelDB, and Memcached. As part of this work, we also found a WMM bug in MariaDB, which AtoMig fixes automatically.
• Software and its engineering → Consistency; Automated static analysis; • Theory of computation → Concurrency.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 898f72fa-1a4d-46f0-8fdb-fd415e57c9a8Cited by top-tier papers4
- Polynima: Practical Hybrid Recompilation for Multithreaded BinariesChinmay Deshpande, Fabian Parzefall, Felicitas Hetzelt, Michael FranzEuroSys 2024 · 3 citations
- Arancini: A Hybrid Binary Translator for Weak Memory Model ArchitecturesSebastian Reimers, Dennis Sprokholt, Martin Fink, Theofilos Augoustis et al.ASPLOS 2026 · 1 citation
- No More Translation at Runtime: LLM-Empowered Static Binary TranslationZhibo Liu, Huaijin Wang, Wai Kin Wong, Daoyuan Wu et al.EuroSys 2026 · 1 citation
- Arm Weak Memory Consistency on Apple Silicon: What Is It Good For?Yossi Khayet, Adam MorrisonASPLOS 2026
Builds on4
- VSync: push-button verification and optimization for synchronization primitives on weak memory modelsJonas Oberhauser, Rafael Lourenco de Lima Chehab, Diogo Behrens, Ming Fu et al.ASPLOS 2021 · 40 citations
- HMC: Model Checking for Hardware Memory ModelsMichalis Kokologiannakis, Viktor VafeiadisASPLOS 2020 · 29 citations
- Lasagne: a static binary translator for weak memory model architecturesRodrigo C. O. Rocha, Dennis Sprokholt, Martin Fink, Redha Gouicem et al.PLDI 2022 · 21 citations
- No barrier in the road: a comprehensive study and optimization of ARM barriersNian Liu, Binyu Zang, Haibo ChenPPoPP 2020 · 10 citations
Related papers
- Rely/Guarantee Reasoning for Multicopy Atomic Weak Memory ModelsNicholas Coughlin, Kirsten Winter, Graeme SmithFM 2021 · 16 citations
- LLM Assistance for Memory SafetyJ. Nausheen Mohammed, Akash Lal, Aseem Rastogi, Rahul Sharma et al.ICSE 2025 · 4 citations
- RELINCHE: Automatically Checking Linearizability under Relaxed Memory ConsistencyPavel Golovin, Michalis Kokologiannakis, Viktor VafeiadisPOPL 2025 · 4 citations
- Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent ProgramsJaemin Hong, Sukyoung RyuICSE 2023 · 17 citations
- CLoF: A Compositional Lock Framework for Multi-level NUMA SystemsRafael Lourenco de Lima Chehab, Antonio Paolillo, Diogo Behrens, Ming Fu et al.SOSP 2021 · 6 citations
