Trading Fences with RMRs and Separating Memory Models

H. Attiya, Danny Hendler, Philipp Woelfel
{"title":"Trading Fences with RMRs and Separating Memory Models","authors":"H. Attiya, Danny Hendler, Philipp Woelfel","doi":"10.1145/2767386.2767427","DOIUrl":null,"url":null,"abstract":"Out-of-order execution of instructions is a common optimization technique for multicores and multiprocessors, which is governed by the memory model of the architecture. Relatively strong memory models, like TSO (supported by x86 and AMD), only allow reads to bypass earlier writes, while other models, like RMO (supported by ARM, POWER and Alpha) and PSO (supported by older SPARC), also allow the reordering of writes to different locations. These reorderings can be prevented by the use of costly fence instructions. In this paper we prove that when writes can be reordered (e.g, in RMO or even PSO), there is a tradeoff between the number of fences, f, and the number of remote memory references (RMRs), r, for a large class of objects, including locks, counters and queues: [f (log r/f + 1) ∈ Ω(log n) .] For example, when one of these objects is implemented using a constant number of fences (e.g., in the Bakery lock), the tradeoff implies that a linear number of RMRs is required (as indeed is the case with the Bakery lock). This gives a complexity separation between the memory models that allow write reordering and those that prohibit it, since a recent paper shows that a lock for CRC: (and related objects) can be implemented in the stronger TSO memory model, with a small, constant number of fences, and a logarithmic number of RMRs. The lower bound uses an information theoretic argument, relating the encoding of n! distinguishable executions to the number of fences and RMRs performed in the course of these executions. We also present a family of algorithms matching the lower bound, which explicitly enforce the required ordering, and hence, are correct even with weak memory models. This shows that the tradeoff is tight, and indicates that for many important objects, fences are mostly needed for avoiding reordering of writes.","PeriodicalId":296307,"journal":{"name":"Proceedings of the 2015 ACM Symposium on Principles of Distributed Computing","volume":"119 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-07-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2015 ACM Symposium on Principles of Distributed Computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2767386.2767427","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

Out-of-order execution of instructions is a common optimization technique for multicores and multiprocessors, which is governed by the memory model of the architecture. Relatively strong memory models, like TSO (supported by x86 and AMD), only allow reads to bypass earlier writes, while other models, like RMO (supported by ARM, POWER and Alpha) and PSO (supported by older SPARC), also allow the reordering of writes to different locations. These reorderings can be prevented by the use of costly fence instructions. In this paper we prove that when writes can be reordered (e.g, in RMO or even PSO), there is a tradeoff between the number of fences, f, and the number of remote memory references (RMRs), r, for a large class of objects, including locks, counters and queues: [f (log r/f + 1) ∈ Ω(log n) .] For example, when one of these objects is implemented using a constant number of fences (e.g., in the Bakery lock), the tradeoff implies that a linear number of RMRs is required (as indeed is the case with the Bakery lock). This gives a complexity separation between the memory models that allow write reordering and those that prohibit it, since a recent paper shows that a lock for CRC: (and related objects) can be implemented in the stronger TSO memory model, with a small, constant number of fences, and a logarithmic number of RMRs. The lower bound uses an information theoretic argument, relating the encoding of n! distinguishable executions to the number of fences and RMRs performed in the course of these executions. We also present a family of algorithms matching the lower bound, which explicitly enforce the required ordering, and hence, are correct even with weak memory models. This shows that the tradeoff is tight, and indicates that for many important objects, fences are mostly needed for avoiding reordering of writes.
使用rmr交易围栏和分离内存模型
指令的乱序执行是多核和多处理器的常见优化技术,它由体系结构的内存模型控制。相对强大的内存模型,如TSO(由x86和AMD支持),只允许读取绕过早期的写入,而其他模型,如RMO(由ARM、POWER和Alpha支持)和PSO(由旧的SPARC支持),也允许对不同位置的写入进行重新排序。这些重新排序可以通过使用昂贵的栅栏指令来防止。在本文中,我们证明了当写操作可以被重新排序时(例如,在RMO甚至PSO中),对于包括锁、计数器和队列在内的大型对象来说,篱笆的数量f和远程内存引用的数量r之间存在权衡:[f (log r/f + 1)∈Ω(log n) .]例如,当这些对象中的一个使用恒定数量的栅栏来实现时(例如,在Bakery锁中),权衡意味着需要线性数量的rmr(正如Bakery锁的情况一样)。这在允许写重排序和禁止写重排序的内存模型之间提供了一个复杂性分离,因为最近的一篇论文表明,CRC(和相关对象)的锁可以在更强的TSO内存模型中实现,具有少量的常数数量的栅栏和对数数量的rmr。下界使用了一个信息理论参数,与n的编码有关!根据在执行过程中执行的围栏和rmr的数量来区分执行。我们还提出了一系列匹配下限的算法,这些算法显式地强制执行所需的排序,因此即使在弱内存模型下也是正确的。这表明权衡是严格的,并且表明对于许多重要对象来说,围栏主要是为了避免写操作的重新排序。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书