一句话:提出 Node Replication,将任意顺序数据结构自动转换为 NUMA 感知的线性一致并发数据结构。
高性能服务器多为 NUMA 架构,需要 NUMA 感知的高效并发数据结构,但手工设计困难且易引入并发缺陷。论文提出 Node Replication(NR),一种黑盒方法:将任意顺序数据结构自动转换为满足线性一致性的 NUMA 感知并发数据结构。NR 借鉴共享内存算法与分布式系统思想,实现 NUMA 感知的共享日志,并用日志在 NUMA 节点间一致地复制数据结构。评估表明,在高竞争下 NR 比无锁算法快 3.1 倍、比基于锁方案快 30 倍;用于 Redis 数据结构时性能最高提升 14 倍;代价是日志与副本的额外内存。
High-performance servers are Non-Uniform Memory Access (NUMA) machines. To fully leverage these machines, programmers need efficient concurrent data structures that are aware of the NUMA performance artifacts. We propose Node Replication (NR), a black-box approach to obtaining such data structures. NR takes an arbitrary sequential data structure and automatically transforms it into a NUMA-aware concurrent data structure satisfying linearizability. Using NR requires no expertise in concurrent data structure design, and the result is free of concurrency bugs. NR draws ideas from two disciplines: shared-memory algorithms and distributed systems. Briefly, NR implements a NUMA-aware shared log, and then uses the log to replicate data structures consistently across NUMA nodes. NR is best suited for contended data structures, where it can outperform lock-free algorithms by 3.1x, and lock-based solutions by 30x. To show the benefits of NR to a real application, we apply NR to the data structures of Redis, an in-memory storage system. The result outperforms other methods by up to 14x. The cost of NR is additional memory for its log and replicas.