论文标题

可扩展的范围锁锁可扩展地址空间及以后

Scalable Range Locks for Scalable Address Spaces and Beyond

论文作者

Kogan, Alex, Dice, Dave, Issa, Shady

论文摘要

范围锁是一种同步结构,旨在同时访问多个线程(或过程)以脱节共享资源的部分。最初在文件系统上下文中构思的范围锁正在引起人们对Linux内核社区的兴趣,以减轻虚拟内存管理子系统中的瓶颈。但是,内核中的范围锁的现有实现使用了内部旋转锁来保护底层树结构,以跟踪被收购和请求的范围。当经常获取范围锁定时,此旋转锁会自行成为争论点。此外,可以将特定(精制)范围锁定的确切位置和确切的位置仍然是一个悬而未决的问题。 在本文中,我们做出了两个独立但相关的贡献。首先,我们提出了一种基于链接列表的构建范围锁定的替代方法。这些列表易于以无锁的方式维护,实际上,在常见情况下,我们的范围锁不会使用任何内部锁。其次,我们展示了如何通过投机机制在Moprotect操作中完善锁的范围。反过来,这种改进允许在非重叠的内存区域同时执行mprotect操作。我们实施了新算法,并证明了它们在用户空间和内核空间中的有效性,与Linux内核的库存版本相比,达到9 $ \ times $速度。除了虚拟内存管理子系统之外,我们还讨论了并行软件中范围锁的其他应用。作为具体的示例,我们展示了如何使用范围锁来促进可扩展的并发数据结构(例如跳过列表)的设计。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源