arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2006.12144cs.OScs.DC
收藏

用于可扩展地址空间的可扩展范围锁

Scalable Range Locks for Scalable Address Spaces and Beyond

Alex Kogan, Dave Dice, Shady Issa

摘要:

范围锁是一种同步构造,旨在提供对多个线程(或进程)的并发访问,以分离共享资源的各个部分。范围锁最初是在文件系统上下文中构思的,在Linux内核社区中越来越受到关注,试图减轻虚拟内存管理子系统中的瓶颈。然而,内核中范围锁的现有实现使用内部旋转锁来保护底层树结构,该结构跟踪获取和请求的范围。当频繁获取范围锁时,此旋转锁本身就成为争用点。此外,在何处以及如何确定具体的(精确的)范围仍然是一个悬而未决的问题。在本文中,我们做了两个独立的,但相关的贡献。首先,我们提出了一种基于链表构建范围锁的替代方法。列表很容易以无锁的方式维护,事实上,我们的范围锁在常见情况下不使用任何内部锁。其次,我们展示了如何通过投机机制在mprotect操作中细化锁的范围。这种改进又允许在非重叠存储器区域上并发执行mprotect操作。我们实现了我们的新算法,并证明了它们在用户空间和内核空间的有效性,实现了9个$\times$加速比股票版本的Linux内核。除了虚拟内存管理子系统之外,我们还讨论了范围锁在并行软件中的其他应用。作为一个具体的例子,我们展示了如何范围锁可以用来促进可扩展的并发数据结构,如跳表的设计。

英文摘要:

Range locks are a synchronization construct designed to provide concurrent access to multiple threads (or processes) to disjoint parts of a shared resource. Originally conceived in the file system context, range locks are gaining increasing interest in the Linux kernel community seeking to alleviate bottlenecks in the virtual memory management subsystem. The existing implementation of range locks in the kernel, however, uses an internal spin lock to protect the underlying tree structure that keeps track of acquired and requested ranges. This spin lock becomes a point of contention on its own when the range lock is frequently acquired. Furthermore, where and exactly how specific (refined) ranges can be locked remains an open question. In this paper, we make two independent, but related contributions. First, we propose an alternative approach for building range locks based on linked lists. The lists are easy to maintain in a lock-less fashion, and in fact, our range locks do not use any internal locks in the common case. Second, we show how the range of the lock can be refined in the mprotect operation through a speculative mechanism. This refinement, in turn, allows concurrent execution of mprotect operations on non-overlapping memory regions. We implement our new algorithms and demonstrate their effectiveness in user-space and kernel-space, achieving up to 9$\times$ speedup compared to the stock version of the Linux kernel. Beyond the virtual memory management subsystem, we discuss other applications of range locks in parallel software. As a concrete example, we show how range locks can be used to facilitate the design of scalable concurrent data structures, such as skip lists.

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

↑