Hardware extensions to make lazy subscription safe

Hardware extensions to make lazy subscription safe
复制标题

硬件扩展使延迟订阅变得安全

DOI:
--
复制
发表时间:
2014
期刊:
arXiv.org
影响因子:
--
通讯作者:
Mark Moir
Mark Moir
中科院分区:
--
文献类型:
--
作者:
D. Dice;T. Harris;Alex Kogan;Yossi Lev;Mark Moir

文献摘要

被引文献

相似文献

事务性锁省略(TLE)使用硬件事务性内存(HTM)并发地执行未修改的临界区,即使它们受到相同锁的保护。为了确保正确性,用于执行这些关键区的事务通过读取锁并检查锁是否可用来“订阅”锁。最近的一篇论文建议在不同的上下文中对类似的技术使用诱人的“延迟订阅”优化,即使用单个全局锁(SGL)来保护所有事务数据的事务系统。我们确定了几个缺陷,这些缺陷表明延迟订阅对于TLE来说是不安全的,因为在订阅锁之前执行未修改的临界区可能以许多微妙的方式表现不正确。我们还表明,最近提议的编译器支持修改事务代码,以确保在出现任何错误行为之前发生订阅,但这不足以避免我们发现的所有缺陷。我们进一步指出,扩展这样的编译器支持以避免所有的缺陷会增加大量的复杂性,并且通常会限制订阅可以延迟的程度,从而破坏优化的有效性。在最近的提案中建议的硬件扩展也没有解决我们发现的所有缺陷。在WTTM 2014论文的这个扩展版本中,我们描述了使延迟订阅安全的硬件扩展,无论是对于基于sgl的事务系统还是对于TLE,都不需要特殊的编译器支持。我们还解释了如何利用非事务性负载(如果可用)来进一步增强延迟订阅的有效性。
Transactional Lock Elision (TLE) uses Hardware Transactional Memory (HTM) to execute unmodified critical sections concurrently, even if they are protected by the same lock. To ensure correctness, the transactions used to execute these critical sections “subscribe” to the lock by reading it and checking that it is available. A recent paper proposed using the tempting “lazy subscription” optimization for a similar technique in a different context, namely transactional systems that use a single global lock (SGL) to protect all transactional data. We identify several pitfalls that show that lazy subscription is not safe for TLE because unmodified critical sections executing before subscribing to the lock may behave incorrectly in a number of subtle ways. We also show that recently proposed compiler support for modifying transaction code to ensure subscription occurs before any incorrect behavior could manifest is not sufficient to avoid all of the pitfalls we identify. We further argue that extending such compiler support to avoid all pitfalls would add substantial complexity and would usually limit the extent to which subscription can be deferred, undermining the effectiveness of the optimization. Hardware extensions suggested in the recent proposal also do not address all of the pitfalls we identify. In this extended version of our WTTM 2014 paper, we describe hardware extensions that make lazy subscription safe, both for SGL-based transactional systems and for TLE, without the need for special compiler support. We also explain how nontransactional loads can be exploited, if available, to further enhance the effectiveness of lazy subscription.