AtoMig: Automatically Migrating Millions Lines of Code from TSO to WMM

Research output: Contribution to book/Conference proceedings/Anthology/ReportConference contributionContributedpeer-review

Contributors

  • Martin Beck - , Dresden Research Lab Huawei Technologies (Author)
  • Koustubha Bhat - , Dresden Research Lab Huawei Technologies (Author)
  • Lazar Stričević - , Dresden Research Lab Huawei Technologies (Author)
  • Geng Chen - , Huawei Technologies Co., Ltd. (Author)
  • Diogo Behrens - , Dresden Research Lab Huawei Technologies (Author)
  • Ming Fu - , Dresden Research Lab Huawei Technologies (Author)
  • Viktor Vafeiadis - , Max Planck Institute for Software Systems (Author)
  • Haibo Chen - , Huawei Technologies Co., Ltd., Shanghai Jiao Tong University (Author)
  • Hermann Härtig - , Professor (rtd.) of Operating Systems (Author)

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, Postgres, SQlite, LevelDB, and Memcached. As part of this work, we also found a WMM bug in MariaDB, which AtoMig fixes automatically.

Details

Original languageEnglish
Title of host publicationASPLOS 2023 - Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
EditorsTor M. Aamodt, Natalie Enright Jerger, Michael Swift
PublisherAssociation for Computing Machinery
Pages61-73
Number of pages13
ISBN (electronic)9781450399166
Publication statusPublished - 27 Jan 2023
Peer-reviewedYes

Publication series

SeriesASPLOS: Architectural Support for Programming Languages and Operating Systems
Volume2

Conference

Title28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
Abbreviated titleASPLOS 2023
Conference number28
Duration25 - 29 March 2023
Website
LocationSheraton Vancouver Wall Centre
CityVancouver
CountryCanada

Keywords

Keywords

  • memory consistency models, parallelism and concurrency, static analysis, sustainability