Hardware Cache Locking for All Memory Updates
Many applications need to perform operations that involve reading a value from memory, modifying it, and then writing it back. Multiple architectures provide hardware support for these operations via read-modify-write (RMW) instructions. The primary benefit is that the read can request a cacheline with write permissions, reducing coherence protocol overhead since the write will find the cacheline with appropriate permissions. RMWs can be either atomic or non-atomic. Atomic RMWs, used for synchronization, commonly require (i) locking the cacheline to guarantee atomicity by preventing invalidations and (ii) enforcing serialization of instructions in the program (e.g., via memory fences), which may cause performance degradation based on the implemented memory consistency model. Non-atomic RMWs, while not requiring such strict measures, should only be used in data-race free code sections. However, other cores may invalidate a cacheline during a non-atomic RMW (e.g., due to false sharing), flushing the pipeline and causing the loss of write permissions obtained by the read, which is detrimental to performance. In this work, we propose a microarchitectural mechanism that enables non-atomic RMWs to fetch the cacheline locking it, thus preventing other cores from “stealing” the cacheline while allowing them to run concurrently with other instructions in the same core. Our proposal enables concurrent hardware cache locking for multiple non-atomic RMW s while guaranteeing deadlock freedom and no programmer/compiler intervention. We also propose a lock-chaining mechanism to allow multiple consecutive memory updates to the same cacheline up to a predefined maximum (to prevent starvation and load imbalance). Our evaluation using gem5 full-system simulator shows that for an eight-core configuration, our proposal improves performance by up to 5.36 % (2.05 % on average), requiring just 45 bytes of storage per core.
Authors
- Eduardo José Gómez-Hernández (ORCID: https://orcid.org/0000-0001-8445-615X)
- Stefanos Kaxiras (ORCID: https://orcid.org/0000-0001-8267-0232)
- Juan M. Cebrián (ORCID: https://orcid.org/0000-0002-3731-9301)
- Ashkan Asgharzadeh
- Alberto Ros (ORCID: https://orcid.org/0000-0001-5757-1064)
Institutions
- Uppsala University (SE)
- Universidad de Murcia (ES)
Publication Details
- Published
- 2024-11-18
- DOI
- https://doi.org/10.1109/iccd63220.2024.00092
- Citations
- 3
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 1.47