[论文解读] The Influence of Malloc Placement on TSX Hardware Transactional Memory
本文表明,动态内存分配器的放置策略会因L1缓存索引冲突而显著影响英特尔TSX硬件事务内存的中止率。通过使用索引感知分配器(CIA-Malloc),作者减少了冲突未命中和中止次数,从而在事务锁消除(TLE)工作负载中提升了并发性和吞吐量,尤其是在存在病态内存访问模式的情况下。
The hardware transactional memory (HTM) implementation in Intel's i7-4770 "Haswell" processor tracks the transactional read-set in the L1 (level-1), L2 (level-2) and L3 (level-3) caches and the write-set in the L1 cache. Displacement or eviction of read-set entries from the cache hierarchy or write-set entries from the L1 results in abort. We show that the placement policies of dynamic storage allocators -- such as those found in common "malloc" implementations -- can influence the L1 conflict miss rate in the L1. Conflict misses -- sometimes called mapping misses -- arise because of less than ideal associativity and represent imbalanced distribution of active memory blocks over the set of available L1 indices. Under transactional execution conflict misses may manifest as aborts, representing wasted or futile effort instead of a simple stall as would occur in normal execution mode. Furthermore, when HTM is used for transactional lock elision (TLE), persistent aborts arising from conflict misses can force the offending thread through the so-called "slow path". The slow path is undesirable as the thread must acquire the lock and run the critical section in normal execution mode, precluding the concurrent execution of threads in the "fast path" that monitor that same lock and run their critical sections in transactional mode. For a given lock, multiple threads can concurrently use the transactional fast path, but at most one thread can use the non-transactional slow path at any given time. Threads in the slow path preclude safe concurrent fast path execution. Aborts rising from placement policies and L1 index imbalance can thus result in loss of concurrency and reduced aggregate throughput.
研究动机与目标
- 调查动态内存分配器的放置方式如何影响英特尔TSX中硬件事务内存(HTM)的中止率。
- 识别出L1缓存索引冲突——由非均匀内存访问模式引起——即使在缓存容量未超限时,也会导致TSX中的中止。
- 评估索引感知内存分配器是否能减少HTM工作负载中的冲突未命中和中止次数。
- 证明此类分配器可通过最小化无谓事务中止,提升事务锁消除(TLE)中的性能和并发性。
- 提供一种实用且低成本的缓解策略(CIA-Malloc),以应对HTM系统中因缓存索引失衡导致的性能下降。
提出的方法
- 实现了一种改进的malloc分配器(CIA-Malloc),该分配器了解i7-4770的L1缓存结构,特别是其8路组相联结构(64个组)和4KB页对齐特性。
- 通过地址哈希和分配大小随机化,将内存块分布在L1缓存组中,以减少索引冲突。
- 使用单线程环形遍历和多线程AVL树工作负载进行微基准测试,以测量事务成功率。
- 在事务锁消除(TLE)和传统事务同步(TTS)下测量性能,比较GLIBC malloc与CIA-Malloc的差异。
- 通过测量不同分配大小下的中止率和吞吐量,隔离出因索引冲突导致性能下降的病态情况。
- 应用事务重排序技术(例如,将存储操作移至事务末尾)以降低写集驱逐风险,并验证其在i7-4770的非对称写集跟踪机制中的有效性。
实验结果
研究问题
- RQ1malloc分配方式在多大程度上影响英特尔TSX硬件事务内存中的中止率?
- RQ2由分配器放置引发的L1缓存索引冲突,如何在HTM中表现为事务中止?
- RQ3索引感知分配器能否减少HTM工作负载中的冲突未命中并提高事务成功率?
- RQ4病态分配大小对TLE并发性和吞吐量有何性能影响?
- RQ5事务重排序(例如,将存储操作移至事务末尾)如何缓解因写集驱逐导致的中止?
主要发现
- 在TLE下,病态分配大小(例如约2000字节)导致GLIBC malloc出现显著性能下降,4线程吞吐量甚至低于串行TTS,原因在于中止率过高。
- CIA-Malloc分配器减少了由L1缓存索引冲突引起的中止,提升了环形遍历和AVL树基准测试中的吞吐量。
- 在2000字节分配时,TTSTLE使用CIA-Malloc的性能优于使用GLIBC malloc,证明分配器选择直接影响TLE性能。
- 研究观察到,只读事务在缓存占用高达7.5MB时仍可成功,但无任何成功事务超过8MB(L3缓存大小),表明L3容量是硬性限制。
- 即使缓存容量未超限,由索引失衡引起的冲突未命中仍会导致中止,且这些中止迫使线程进入慢速路径,降低TLE中的并发性。
- 索引感知分配器提供了一种低成本且有效的病态中止缓解方案,无需硬件更改,且可低开销地集成到现有系统中。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。