False Conflict Reduction in the Swiss Transactional Memory (SwissTM) System Aravind Natarajan Department of Computer Engineering The University of Texas at Dallas Richardson, TX - 75080, USA Email: aravindn@utdallas.edu Neeraj Mittal Department of Computer Science The University of Texas at Dallas Richardson, TX - 75080, USA Email: neerajm@utdallas.edu Abstract—Software Transactional Memory (STM) is a pro- gramming paradigm that allows a programmer to write par- allel programs, without having to deal with the intricacies of synchronization. That burden is instead borne by the underly- ing STM system. SwissTM is a lock-based STM, developed at EPFL, Switzerland. Memory locations map to entries in a lock table to detect conflicts. Increasing the number of locations that map to a lock reduces the number of locks to be acquired and improves throughput, while also increasing the possibility of false conflicts. False conflicts occur when a transaction that updates a location mapping to a lock, causes validation failure of another transaction, that reads a different location mapping to the same lock. In this paper, we present a solution for the false conflict problem and suggest an adaptive version of the same algorithm, to improve performance. Our algorithms produce significant throughput improvement in benchmarks with false conflicts. Keywords-Software Transactional Memory; SwissTM; false conflict; history logging; I. I NTRODUCTION Advances in Very Large Scale Integration (VLSI) design and Computer Architecture have helped sustain an expo- nential performance improvement in sequential programs, for nearly 50 years. However, with processor designers now shifting their focus towards multi-core systems, par- allel programming has acquired new importance. Parallel programming suffers from algorithm design and debugging complexities. Coarse grained locking schemes offer imple- mentation advantages over fine grained approaches, but that is at the cost of performance. Software Transactional Memory (STM) [1], [2] is an ap- proach that aims to achieve middle ground between perfor- mance and ease of programming on parallel architectures. By treating concurrent memory accesses as database trans- actions that either appear to commit atomically or abort without any trace, consistency can be achieved. Program- mers using Transaction Memory (TM) systems are required to explicitly demarcate the shared data accesses within a transactional construct, as they would normally do with critical sections. However, the burden of synchronization is now shifted to the TM system. This is particularly appealing as it does not require a drastic change in programming style. As a result STMs are widely being pursued by a number of research groups and there are currently several STM implementations available [3]–[9]. The STM design space is very vast, and one of the most fundamental choices is that of a lock based or non-blocking STM. Lock based STM implementations have been shown to perform better than non-blocking ones owing to the lesser validation overhead involved. SwissTM [9] is one such lock- based TM implementation, developed by the Distributed Programming Laboratory at EPFL in Lausanne, Switzerland. SwissTM uses a mixed conflict detection scheme [9] and has a two-phase contention manager. It has been shown in [9] that SwissTM outperforms RSTM and TLII. SwissTM uses a global lock table to detect conflicting transactional accesses to memory locations. However, we have observed that false conflicts can significantly impact performance in SwissTM. A false conflict in SwissTM occurs when a committing transaction updating a memory location, x, that maps to a lock causes validation failure of another memory location, y, that maps to the same lock even when y has not been modified in the mean time. Such aborts can impact performance significantly, especially when a frequently read memory location maps to the same lock as a contention hotspot. We propose and implement an algorithm, that we call History Logging (HL), for SwissTM that pro- duces significant performance improvement in benchmarks that suffer from false conflicts. The additional overhead of our approach causes performance to drop in cases where we do not have a significant number of false conflict aborts. In those cases the original SwissTM algorithm, which we term No Logging (NL), performs better than HL. Hence, we also present Adaptive History Logging (AHL), that improves upon the throughput of HL in such cases. The remainder of the paper is organized as follows. In Sections 2 and 3 we give a short overview of the types of STMs and introduce SwissTM. Sections 4 and 5 describe the False Conflict Problem and our proposed solutions. We present the benchmarks used in our simulations in section 6, the results in Section 7 and our conclusions in section 8. II. BACKGROUND AND RELATED WORK A Transactional Memory system allows an application programmer to write concurrent code, without the 978-1-4244-6534-7/10/$26.00 ©2010 IEEE