Skip to main content
QUICK REVIEW

[论文解读] Measuring Software Performance on Linux

Martin Becker, Samarjit Chakraborty|arXiv (Cornell University)|Nov 4, 2018
Parallel Computing and Optimization Techniques参考文献 12被引用 4
一句话总结

本文提出了一套系统化的测量设置,用于在现代x86处理器的Linux系统上精确评估软件性能。通过最小化操作系统和硬件干扰——尤其是通过CPU频率调节、cgroups和中断管理——该方法减少了时间抖动,提升了测量可靠性,特别是在后台负载下,性能退化从默认配置下的最高64%降低至本方案配置下的6%以下。

ABSTRACT

Measuring and analyzing the performance of software has reached a high complexity, caused by more advanced processor designs and the intricate interaction between user programs, the operating system, and the processor's microarchitecture. In this report, we summarize our experience about how performance characteristics of software should be measured when running on a Linux operating system and a modern processor. In particular, (1) We provide a general overview about hardware and operating system features that may have a significant impact on timing and how they interact, (2) we identify sources of errors that need to be controlled in order to obtain unbiased measurement results, and (3) we propose a measurement setup for Linux to minimize errors. Although not the focus of this report, we describe the measurement process using hardware performance counters, which can faithfully reflect the real bottlenecks on a given processor. Our experiments confirm that our measurement setup has a large impact on the results. More surprisingly, however, they also suggest that the setup can be negligible for certain analysis methods. Furthermore, we found that our setup maintains significantly better performance under background load conditions, which means it can be used to improve software in high-performance applications.

研究动机与目标

  • 解决Linux系统缺乏标准化、可靠的性能测量实践的问题。
  • 识别并缓解由操作系统和微架构特性引入的时间误差源。
  • 提出一种可复现、低抖动的测量设置,以隔离软件性能与系统级噪声。
  • 证明测量设置显著影响绝对性能指标,但对基于比率的分析影响极小。
  • 在后台负载条件下提升性能测量的稳定性和可靠性。

提出的方法

  • 禁用CPU频率调节(例如使用'performance'调度器),以消除时钟频率波动的影响。
  • 使用cgroups隔离目标进程,以限制其他进程和中断的干扰。
  • 禁用CPU空闲状态(C-states)和中断缓解机制(例如本地APIC定时器、ftrace),以减少时间抖动。
  • 通过Linux的'perf'工具使用硬件性能计数器收集精确的事件计数(例如缓存未命中、分支预测错误)。
  • 应用分层性能分析并结合不确定性传播,量化测量误差范围。
  • 在不同后台负载条件下,通过受控实验比较默认配置与优化后配置的性能表现。

实验结果

研究问题

  • RQ1Linux操作系统的特性(如CPU频率调节、C-states和中断处理)如何影响软件时间测量?
  • RQ2哪些特定的系统配置能最小化测量抖动并提升性能测试的可复现性?
  • RQ3测量设置在多大程度上影响绝对性能指标,而对基于比率的性能分析又有多大影响?
  • RQ4后台系统负载如何影响性能测量的稳定性,且所提出的设置能否缓解此影响?
  • RQ5标准化的测量设置能否提升高性能应用性能数据的可靠性?

主要发现

  • 所提出的测量设置将默认配置下高达64%的性能退化降低至后台负载下不足6%。
  • 对于绝对事件计数(例如缓存未命中),该设置表现出显著改进,流处理性能在默认设置下退化达67%,而在本方案下仅退化2%。
  • 该设置在后台负载下保持了稳定的性能表现,相比默认配置展现出更强的鲁棒性。
  • 出人意料的是,对于基于比率的性能分析(例如加速比),测量设置对结果影响极小,表明相对比较具有鲁棒性。
  • 硬件性能计数器(通过'perf'获取)能准确识别性能瓶颈,但其准确性高度依赖于测量设置。
  • 该设置显著降低了抖动和测量不确定性,尤其在结合cgroups和CPU隔离时效果更明显。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。