arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1810.01553cs.OS
收藏

BRAVO --读写器锁的偏置锁定

BRAVO -- Biased Locking for Reader-Writer Locks

David Dice, Alex Kogan

摘要:

现代读写器锁的设计者面临着与读取器可伸缩性相关的困难权衡。具有用于活动读取器的紧凑存储器表示的锁通常将在高强度读取主导的工作负载下受到影响,此时“读取器指示符”状态由不同的线程集频繁更新,从而导致高速缓存无效和一致性流量。其他设计(如队列读写器锁)使用分布式读取器指示器,每个NUMA节点一个。这提高了读者-读者的可扩展性,但也增加了每个锁实例的大小。我们提出了一个简单的转换BRAVO,增加任何现有的读写器锁,只添加两个整数字段的锁实例。读取器通过用锁地址散列线程的标识,使写入器知道它们的存在,从而在可见的读取器表中形成索引。读取器尝试将锁地址安装到表中的该元素中,使潜在的写入器知道它们的存在。地址空间中的所有锁和线程都可以共享可见读取器表。读者的更新往往会分散在整个表中,从而形成了一个对NUMA友好的设计。至关重要的是,同一锁的读取器倾向于写入数组中的不同位置,从而减少了一致性流量。具体地说,BRAVO允许一个简单的紧凑锁被增强,以便提供可扩展的并发读取,但占用空间只有适度的增加。

英文摘要:

Designers of modern reader-writer locks confront a difficult trade-off related to reader scalability. Locks that have a compact memory representation for active readers will typically suffer under high intensity read-dominated workloads when the "reader indicator"' state is updated frequently by a diverse set of threads, causing cache invalidation and coherence traffic. Other designs, such as cohort reader-writer locks, use distributed reader indicators, one per NUMA node. This improves reader-reader scalability, but also increases the size of each lock instance. We propose a simple transformation BRAVO, that augments any existing reader-writer lock, adding just two integer fields to the lock instance. Readers make their presence known to writers by hashing their thread's identity with the lock address, forming an index into a visible readers table. Readers attempt to install the lock address into that element in the table, making their existence known to potential writers. All locks and threads in an address space can share the visible readers table. Updates by readers tend to be diffused over the table, resulting in a NUMA-friendly design. Crucially, readers of the same lock tend to write to different locations in the array, reducing coherence traffic. Specifically, BRAVO allows a simple compact lock to be augmented so as to provide scalable concurrent reading but with only a modest increase in footprint.

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

↑