一句话:ProRace 通过 PMU 指令采样与离线重建未采样访存,实现生产可用的低开销动态数据竞争检测。
动态数据竞争检测难以同时满足生产运行的低开销与高检出率。ProRace 利用商用处理器性能监控单元(PMU)进行指令采样来跟踪内存访问,并通过定制的 PMU 驱动以更低成本采样更多访存。此外,它利用 PMU 提供的执行上下文(寄存器状态与程序路径)离线重建未被采样的访存,从而突破采样的固有局限,在同时包含采样与重建访存的轨迹上进行竞争检测。在 Apache、MySQL 等存在竞争的生产软件上评估表明,采样周期为 10,000 时,ProRace 运行时开销仅 2.6%、检测概率达 27.5%,且离线代价合理。
This paper presents ProRace, a dynamic data race detector practical for production runs. It is lightweight, but still offers high race detection capability. To track memory accesses, ProRace leverages instruction sampling using the performance monitoring unit (PMU) in commodity processors. Our PMU driver enables ProRace to sample more memory accesses at a lower cost compared to the state-of-the-art Linux driver. Moreover, ProRace uses PMU-provided execution contexts including register states and program path, and reconstructs unsampled memory accesses offline. This technique allows \ProRace to overcome inherent limitations of sampling and improve the detection coverage by performing data race detection on the trace with not only sampled but also reconstructed memory accesses. Experiments using racy production software including apache and mysql shows that, with a reasonable offline cost, ProRace incurs only 2.6% overhead at runtime with 27.5% detection probability with a sampling period of 10,000.