RiuNet. Repositorio Institucional de la Universitat Politécnica de Valéncia
Publication
Contribución de congreso (ConferenceOutput)
No Rush in Executing Atomic Instructions
[EN] Hardware atomic instructions are the building blocks of the synchronization algorithms. Historically, to guarantee atomicity and consistency, they were implemented using memory fences, committing older memory instructions, and draining the store buffer before initiating the execution of atomics. Unfortunately, the use of such memory fences entails huge performance penalties as it implies execution serialization, thus impeding instruction- and memory-level parallelism. The situation, however, seems to have changed recently. Through experiments on x86 machines, we discovered that current x86 processors manage to comply with the x86-TSO requirements while avoiding the performance overhead introduced by fences (fence-free or unfenced implementation). This paves the way to new potential optimizations to atomic instruction execution. In particular, our simulation experiments modeling unfenced atomics reveal that executing atomic instructions as soon as their operands are ready does not always lead to optimal performance. In fact, this increases the time that other threads should wait to obtain the cacheline. In contended scenarios, delaying the execution of the atomic instruction to minimize the time the cacheline is locked provides superior performance. Based on this observation, we present Rush or Wait (RoW), a hardware mechanism to decide when to execute an atomic instruction. The mechanism is based on a contention predictor that estimates if an atomic will access a contended cacheline. Non-contended atomics execute once their operands are ready. Contended atomics, on the contrary, wait to become the oldest memory instruction and to drain the store buffer to execute, minimizing the contention on the accessed cacheline. Our experimental evaluation shows that RoW reduces execution time on average by 9.2% (and up to 43%) compared to a baseline that executes atomics as soon as the operands are ready, and yet it requires a small area overhead (64 bytes)., This project has received funding from the European Research Council (ERC) under the European Union s Horizon
2020 research and innovation programme (grant agreement
No 819134), from the MCIN/AEI/10.13039/501100011033/
and the ERDF A way of making Europe , EU (grants
PID2021-123627OB-C51 and PID2022-136315OB-I00), from
the MCIN/AEI/10.13039/501100011033/ and the European
Union NextGenerationEU/PRTR (grants RYC2021-030862-I
and TED2021-130233B-C33), from the Swedish Research
Council (VR grant 2022-04959), and from the Swedish Foundation for Strategic Research (SSF grant FUS21-0067).
Project:
Agencia Estatal de Investigación / Plan Estatal de Investigación Científica y Técnica y de Innovación 2021-2023 PID2021-123627OB-C52
,
Agencia Estatal de Investigación / Plan Estatal de Investigación Científica y Técnica y de Innovación 2021-2023 PID2022-136315OB-I00
,
European Commission / H2020 819134
,
CIENCIA E INNOVACION RYC2021-030862-I
,
European Research Council 819134
,
Agencia Estatal de Investigación PID2021-123627OB-C52
,
Ministerio de Ciencia e Innovación TED2021-130233B-C32
,
Swedish Research Council 2022-04959
,
SSF FUS21-0067