一句话:提出 pLock,利用显式核间消息传递实现高性能互斥锁,并通过链式与层次锁降低消息开销。
同步是多线程程序的关键问题,互斥锁因其直观性仍被广泛使用。SW26010 架构提供硬件支持的显式核间消息传递(EMP)和快速片上网络,为锁实现带来机会与挑战,但此前缺少面向该特性的通用锁优化。本文提出 pLock:一种面向支持 EMP 架构的快速锁。它使用部分核作为锁服务器,并利用快速片上网络实现高性能互斥锁;同时提出链式锁和层次锁两种技术,以减少消息数量并缓解网络拥塞。作者在 SW26010 处理器上实现并评估,结果表明这些技术相对基础 EMP-lock 设计最高提升 19.4 倍性能。
Synchronization is a significant issue for multi-threaded programs. Mutex lock, as a classic solution, is widely used in legacy programs and is still popular for its intuition. The SW26010 architecture, deployed on the supercomputer Sunway Taihulight, introduces hardware-supported inter-core message passing mechanism and exposes explicit interfaces for developers to use its fast on-chip network. This emerging architectural feature brings both opportunities and challenges for mutex lock implementation. However, there is still no general lock mechanism optimized for architectures with this new feature. In this paper, we propose pLock, a fast lock designed for architectures that support Explicit inter-core Message Passing (EMP). pLock uses partial cores as lock servers and leverages the fast on-chip network to implement high-performance mutual exclusive locks. We propose two new techniques -- chaining lock and hierarchical lock -- to reduce message count and mitigate network congestion. We implement and evaluate pLock on an SW26010 processor. The experimental results show that our proposed techniques improve the performance of EMP-lock by up to 19.4x over a basic design.