[论文解读] Fully Read/Write Fence-Free Work-Stealing with Multiplicity
本文提出了首个完全无读写屏障(fence-free)的多值(multiplicity)工作窃取算法,其中多值是一种松弛机制,允许多个操作提取同一任务,但确保每个进程最多仅获取一次特定任务。所提出的算法消除了所有操作中的读-写后同步模式(Read-After-Write patterns)以及读/写屏障,实现了无等待(wait-freedom)和对数或常数级步骤复杂度,实验结果表明其性能优于 Cilk、Chase-Lev 和幂等(idempotent)工作窃取算法。
Work-stealing is a popular technique to implement dynamic load balancing in a distributed manner. In this approach, each process owns a set of tasks that have to be executed. The owner of the set can put tasks in it and can take tasks from it to execute them. When a process runs out of tasks, instead of being idle, it becomes a thief to steal tasks from a victim. Thus, a work-stealing algorithm provides three high-level operations: Put and Take, which can be invoked only by the owner, and Steal, which can be invoked by a thief. One of the main targets when designing work-stealing algorithms is to make Put and Take as simple and efficient as possible. Unfortunately, it has been shown that any work-stealing algorithm in the standard asynchronous model must use expensive Read- After-Write synchronization patterns or atomic Read-Modify-Write instructions, which may be costly in practice. Thus, prior research has proposed idempotent work-stealing, a relaxation for which there are algorithms with Put and Take devoid of Read-Modify-Write atomic instructions and Read-After-Write synchronization patterns; however, Put uses fences among Write instructions, and Steal uses Compare&Swap and fences among Read instructions. In the TSO model, in which Write (resp. Read) instructions cannot be reordered, there have been proposed fully fence-free work-stealing algorithms whose Put and Take have similar properties but Steal uses Compare&Swap or a lock.
研究动机与目标
- 解决传统工作窃取算法中读-写后同步与原子读-修改-写指令带来的性能瓶颈。
- 设计一种松弛的工作窃取模型,允许多个操作提取同一任务,但确保每个进程最多仅获取一次任务。
- 在标准异步共享内存模型下,实现完全无读/写屏障且无等待的工作窃取算法。
- 证明简单同步原语足以支持非平凡的协调操作,例如生成树计算。
- 将所提算法与 Cilk、Chase-Lev 和幂等工作窃取等现有方案进行性能对比评估。
提出的方法
- 引入两种松弛机制:多值(multiplicity)与弱多值(weak multiplicity),允许每个任务被多个 Take/Steal 操作提取,但限制每个进程仅能从中提取一次。
- 将带多值的工作窃取问题规约为 MaxRegister 和 RangeMaxRegister 数据结构,二者为 MaxRegister 的松弛版本。
- 设计一种基于 MaxRegister 管理工作队列头部的无等待、无屏障算法,用于弱多值场景。
- 实现第二种算法,用于多值场景,具有对数级步骤复杂度,基于 RangeMaxRegister 抽象。
- 确保所有 Put、Take 和 Steal 操作仅使用读/写指令,不依赖屏障或原子读-修改-写操作。
- 采用有界缓冲区模型,避免在 TSO 类似环境中的指令重排序问题,从而支持无屏障执行。
实验结果
研究问题
- RQ1是否可以在所有操作(包括 Steal)中完全消除读-写后同步模式与屏障,实现真正的无屏障工作窃取?
- RQ2能否在允许任务多值提取的松弛语义下,设计出无等待的工作窃取算法?
- RQ3MaxRegister 和 RangeMaxRegister 抽象是否可用于实现高效、无屏障的多值工作窃取?
- RQ4所提算法在实践中是否优于 Cilk、Chase-Lev 和幂等工作窃取等现有工作窃取算法?
- RQ5多值松弛是否能在保持正确性与性能的前提下,使同步机制更简化?
主要发现
- 所提出的 WS-WMULT 算法在 Intel Core i7 和 Xeon 集群上,性能优于 Cilk、Chase-Lev 和幂等工作窃取。
- 在有向 3D 网格中,WS-WMULT 相较于 Chase-Lev 最高提升 36.61%,相较幂等 FIFO 提升 8.65%,相较幂等 LIFO 提升 19.6%。
- 在无向 3D 网格中,WS-WMULT 相较于 Chase-Lev 最高提升 12.25%,相较幂等 LIFO 提升 5.95%,相较幂等 FIFO 提升 0.78%。
- 采用 Swap 指令的有界变体 B-WS-WMULT 性能低于 WS-WMULT,但仍与其它算法保持竞争力。
- 弱多值算法为完全无屏障,且具有常数级步骤复杂度,是文献中首个此类解决方案。
- 理论分析表明,带多值的工作窃取处于共识数层次的最低端,表明其仅需最小程度的同步能力。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。