Weak memory models allow for simplified hardware and increased performance in the memory hierarchy at the cost of increased software complexity. In weak memory models, explicit synchronization is needed to enforce ordering between different processors. Acquire and release semantics provide a powerful primitive for expressing only the ordering required for correctness. In this project, we explore adding load-acquire and store-release instructions to the RISC-V ISA. We add support to the herd formal memory model, the gem5 cycle-approximate simulator, and the LLVM/Clang toolchain. Because these instructions do not exist in the RISC-V standard, there is an inherent urgency to ratify explicit load-acquire/store-release instructions in order to prevent multiple ABI implementations and ecosystem fragmentation. We found that for workloads with a high degree of sharing and heavy contention, the impact of less memory ordering is muted, but our changes successfully encode the semantics we desire.
翻译:微弱的记忆模型可以简化硬件,提高记忆层的性能,而软件复杂性则会增加。在弱的记忆模型中,执行不同处理器之间的命令需要明确同步。获取和发布语义为表达正确性所需的命令提供了强大的原始力量。在这个项目中,我们探索在RISC-V ISA中添加负载-获取和存储-释放指令。我们为散装正式记忆模型、宝石5循环模拟器和LLLVM/Clang 工具链增加支持。由于这些指令没有在RISC-V标准中存在,因此批准明确的负载-获取/存储-释放指令是固有的紧迫性,以防止多部ABB执行和生态系统支离散。我们发现,对于高度共享和激烈争议的工作量,记忆调用较少的影响被淡化,但我们的变化成功地将我们希望的语义编码化。