arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1810.05600cs.OS
收藏

紧凑型NUMA识别锁

Compact NUMA-Aware Locks

Dave Dice, Alex Kogan

摘要:

现代多套接字架构表现出非均匀存储器访问(NUMA)行为,其中核对套接字上本地缓存的数据的访问比对远程套接字上缓存的数据的访问快得多。以前的工作提供了几个有效的NUMA感知锁,通过将锁所有权保持在同一个套接字上来利用这种行为,从而减少远程缓存未命中和套接字间通信。然而,实际上所有这些锁本质上都是分层的,因此需要与套接字数量成比例的空间。内存开销的增加使得NUMA感知锁不适合那些意识到同步结构的空间需求的系统,Linux内核就是主要的例子。在这项工作中,我们提出了一个紧凑的NUMA感知锁,只需要一个字的内存,无论在底层机器的套接字的数量。新锁是高效(NUMA无关)MCS锁的变体,并继承了其性能特性,例如本地旋转和获取路径中的单个原子指令。与MCS不同,新锁将等待线程组织在两个队列中,一个队列由与当前锁持有者在同一套接字上运行的线程组成,另一个队列由在不同套接字上运行的线程组成。我们将新锁集成到Linux内核的qspinlock中,这是内核中的主要同步结构之一。我们使用用户空间和内核基准测试的评估表明,新锁具有MCS的单线程性能,但在争用下明显优于后者,与其他需要更多空间的最先进的NUMA感知锁相比,实现了类似的性能水平。

英文摘要:

Modern multi-socket architectures exhibit non-uniform memory access (NUMA) behavior, where access by a core to data cached locally on a socket is much faster than access to data cached on a remote socket. Prior work offers several efficient NUMA-aware locks that exploit this behavior by keeping the lock ownership on the same socket, thus reducing remote cache misses and inter-socket communication. Virtually all those locks, however, are hierarchical in their nature, thus requiring space proportional to the number of sockets. The increased memory cost renders NUMA-aware locks unsuitable for systems that are conscious to space requirements of their synchronization constructs, with the Linux kernel being the chief example. In this work, we present a compact NUMA-aware lock that requires only one word of memory, regardless of the number of sockets in the underlying machine. The new lock is a variant of an efficient (NUMA-oblivious) MCS lock, and inherits its performant features, such as local spinning and a single atomic instruction in the acquisition path. Unlike MCS, the new lock organizes waiting threads in two queues, one composed of threads running on the same socket as the current lock holder, and another composed of threads running on a different socket(s). We integrated the new lock in the Linux kernel's qspinlock, one of the major synchronization constructs in the kernel. Our evaluation using both user-space and kernel benchmarks shows that the new lock has a single-thread performance of MCS, but significantly outperforms the latter under contention, achieving a similar level of performance when compared to other, state-of-the-art NUMA-aware locks that require substantially more space.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑