评估原子操作在现代体系结构上的成本
Evaluating the Cost of Atomic Operations on Modern Architectures
摘要:
原子操作(atomics),如比较和交换(CAS)或提取和添加(FAA)在并行编程中无处不在。然而,这些操作和这些系统的各种特性,如高速缓存的结构之间的性能权衡是不清楚的,并没有得到彻底的分析。在本文中,我们建立了一个评估方法,开发了一个性能模型,并提出了一套详细的基准测试不同的原子的延迟和带宽。我们考虑各种最先进的x86架构:Intel Haswell、Xeon Phi、Ivy Bridge和AMD Bulldozer。结果揭示了令人惊讶的性能之间的关系所考虑的原子和架构属性,如访问的高速缓存行的一致性状态。一个关键的发现是,所有测试的原子都具有可比的延迟和带宽,即使它们的特征是不同的共识数。另一个观点是,即使在发出的操作之间没有依赖关系,原子的硬件实现也会阻止任何指令级并行。最后,我们讨论了在分析的架构中发现的性能问题的解决方案。我们的分析可以实现更简单,更有效的并行编程,并加速在现成的机器和大型计算系统中部署的各种架构上的数据处理。
英文摘要:
Atomic operations (atomics) such as Compare-and-Swap (CAS) or Fetch-and-Add (FAA) are ubiquitous in parallel programming. Yet, performance tradeoffs between these operations and various characteristics of such systems, such as the structure of caches, are unclear and have not been thoroughly analyzed. In this paper we establish an evaluation methodology, develop a performance model, and present a set of detailed benchmarks for latency and bandwidth of different atomics. We consider various state-of-the-art x86 architectures: Intel Haswell, Xeon Phi, Ivy Bridge, and AMD Bulldozer. The results unveil surprising performance relationships between the considered atomics and architectural properties such as the coherence state of the accessed cache lines. One key finding is that all the tested atomics have comparable latency and bandwidth even if they are characterized by different consensus numbers. Another insight is that the hardware implementation of atomics prevents any instruction-level parallelism even if there are no dependencies between the issued operations. Finally, we discuss solutions to the discovered performance issues in the analyzed architectures. Our analysis enables simpler and more effective parallel programming and accelerates data processing on various architectures deployed in both off-the-shelf machines and large compute systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。