• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 论文 • 上一篇    下一篇

一种基于频度统计的动态二进制翻译优化方法

李男,庞建民,单征   

  1. (解放军信息工程大学,河南 郑州 450002)
  • 收稿日期:2017-11-03 修回日期:2018-01-08 出版日期:2018-04-25 发布日期:2018-04-25

A dynamic binary translation optimization
method based on frequency statistics

LI Nan,PANG Jianmin,SHAN Zheng   

  1. (PLA Information Engineering University,Zhengzhou 450002,China)
  • Received:2017-11-03 Revised:2018-01-08 Online:2018-04-25 Published:2018-04-25

摘要:

在动态二进制翻译过程中,将执行频度高的代码片段长时间驻留在翻译缓存,同时扩大翻译器一次执行的代码量,是减少上下文切换开销、提升系统效率的有效途径。为此,提出了“热代码识别→超块缓存构造→T-Cache管理策略改进”的优化线索,设计了一种基于频度统计的热代码识别算法,将频度值超过预设阈值的基本块及其后续基本块作为热代码识别条件;基于识别出的热代码,提出了构造超块缓存的思想,将热代码包含的基本块翻译后做物理连接,形成容量更大的超块缓存提供给T-Cache系统;以此为基础,改进了T-Cache系统原有的查找方法和替换策略。实验验证了该优化方法的正确性和有效性,在国产申威处理器平台上,该方法使得标准测试集SPEC 2006获得平均9.34%的性能提升。

关键词: 二进制翻译, 热代码, 超块, T-Cache, QEMU

Abstract:

In a dynamic binary translation process, putting the code with high executing frequency into the translating cache for long time and extending the amount of code executed by the translator at one time is an effective way to reduce the context switching overhead and improve the system efficiency. Therefore, we propose the optimization clue of “identifying the hot code→constructing the super block→improving the T-Cache management method”, and design a hot code identification algorithm based on frequency statistics, which regard the basic block whose executing frequency is more than the preset threshold value as well as its subsequent basic blocks as the hot codes. Besides, we propose an idea of constructing super blocks generated by physically chaining the basic blocks in the hot code and hence owns a larger capacity in order to support the T-Cache system. Based on these, the original search method and replacement strategy of the T-Cache system are improved. Experimental results verify the correctness and the performance of the optimization method. On the domestic ShenWei processor platform, the method makes the standard test set SPEC 2006 achieve an average performance improvement of 9.34%.
 
 

Key words: binary translation, hot code, super block, T-Cache, QEMU