[论文解读] Mechanism to Mitigate AVX-Induced Frequency Reduction
本文提出一种基于软件的核心专用化机制,通过将宽向量指令(AVX2/AVX-512)的执行限制在部分核心上,从而缓解英特尔CPU因AVX导致的频率下降问题,实现频率下降影响的隔离。借助调度器接口的线程迁移机制,该方法在无需应用层修改(仅需手动代码注释)的前提下,将性能波动降低了70%以上。
Modern Intel CPUs reduce their frequency when executing wide vector operations (AVX2 and AVX-512 instructions), as these instructions increase power consumption. The frequency is only increased again two milliseconds after the last code section containing such instructions has been executed in order to prevent excessive numbers of frequency changes. Due to this delay, intermittent use of wide vector operations can slow down the rest of the system significantly. For example, previous work has shown the performance of web servers to be reduced by up to 10% if the SSL library uses AVX-512 vector instructions. These performance variations are hard to predict during software development as the performance impact of vectorization depends on the specific workload. We describe a mechanism to reduce the slowdown caused by wide vector instructions without requiring extensive changes to existing software. Our design allows the developer to mark problematic AVX code regions. The scheduler then restricts execution of this code to a subset of the cores so that only these cores' frequency is affected. Threads are automatically migrated to a suitable core whenever necessary. We identify a suitable load balancing policy to ensure good utilization of all available cores. Our approach is able to reduce the performance variability caused by AVX2 and AVX-512 instructions by over 70%.
研究动机与目标
- 解决因Intel CPU上AVX2/AVX-512指令引发的频率缩放而导致异构工作负载性能下降的问题。
- 降低性能波动,恢复向量化代码对无关标量工作负载造成负面影响的系统中性能的可 composability 性。
- 设计一种无侵入性机制,仅将频率下降限制在受影响的核心,从而保留其他核心的性能。
- 评估在线程迁移作为同构CPU架构中核心专用化透明解决方案的可行性与有效性。
提出的方法
- 该机制利用调度器接口标记使用AVX2或AVX-512指令的代码区域,从而实现自动线程向指定核心的迁移。
- 仅允许部分核心执行宽向量指令,因此频率下降仅影响这些核心,而不波及整个系统。
- 当线程尝试在未指定执行此类操作的核心上执行宽向量指令时,触发线程迁移。
- 系统利用现有的故障-迁移机制,通过指令异常启动迁移至具备AVX支持的核心。
- 原型与MuQSS调度器集成,并使用手动插桩识别向量化代码段。
- 未来工作旨在通过反汇编、性能计数器和最后分支记录自动检测AVX密集型代码段。
实验结果
研究问题
- RQ1将AVX2/AVX-512执行隔离至部分核心,能否有效减轻因频率缩放导致的系统级性能下降?
- RQ2线程迁移在同构CPU架构中作为无侵入性机制实现核心专用化的程度如何?
- RQ3在调度器层面通过接口标记向量化代码区域,在最小化性能波动方面有多有效?
- RQ4能否利用硬件性能计数器和最后分支记录实现AVX密集型代码区域的自动检测?
主要发现
- 所提出的机制在评估的工作负载中,将AVX引发的频率下降性能影响降低了70%以上。
- 该方法成功将频率下降限制在执行向量化代码的核心上,其他核心的性能保持完整。
- 对nginx和OpenSSL工作负载的评估证实,该机制在保持高吞吐量的同时,显著降低了性能波动。
- 对向量化代码区域的手动插桩可实现透明的线程迁移,且无需修改应用程序。
- 原型验证了在现有英特尔服务器CPU上,软件定义的核心专用化是可行且有效的。
- 未来通过故障-迁移技术(利用FXSTOR大小限制触发异常)实现自动化的前景良好,有望消除手动插桩的需要。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。