透過您的圖書館登入
IP:18.222.155.58
  • 學位論文

系統模式動態二進制碼轉譯之追蹤式最佳化

Trace-based Optimizations for System-mode Dynamic Binary Translation

指導教授 : 劉邦鋒
共同指導教授 : 吳真貞(Jan-Jan Wu)

摘要


對於許多應用程式來說系統模式動態二進制碼轉譯是一項重要的關鍵技術 。 舉例來說 , 系統模式動態二進制碼轉譯可以協助系統程式以及計算機架構的開發工程師對於其開發的程式做追蹤 、 除蟲以及重現問題 。 QEMU 是一個有名且開源的系統模式動態二進制碼轉譯器, 但是在系統模式下效能並不夠好 , 仍然有改善的空間 。 所以改善 QEMU 系統模式的效能是一個重要的議題 。追蹤式優化是一個用來改善系統模式動態二進制碼的關鍵技術 , 而HQEMU是一個使用追蹤式優化配合多執行緒的動態二進制碼轉譯器 。 對於 SPEC CPU 2006 integer benchmark , 在使用者模式下 HQEMU 可以比 QEMU 快 2.4 倍 , 但是在系統模式下HQEMU 比 QEMU 還慢 。在本研究中 , 我們發現直接將使用者模式下的追蹤式優化直接在系統模式下使用會造成效能不彰 。 我們使用實驗以及採集資料的方式抓出系統模式下的 HQEMU 動態二進制碼轉譯器的問題 。 並且我們提出兩個優化來解決我們找出的問題 , 第一種優化是對應程序分配追蹤式優化要求佇列 , 第二種優化是下沉軟體式記憶體管理程式碼 。 在加入這兩種優化至系統模式 HQEMU 動態二進制碼轉譯器後 , 系統模式 HQEMU 動態二進制碼轉譯器在 SPEC CPU 2006 integer benchmark 下可以比系統模式 QEMU 動態二進制碼轉譯器快 1.16 倍 , 另外在 nBench benchmark 下外快 1.62 倍 。

並列摘要


System mode dynamic binary translation (DBT) is an important technology to many applications. For example, system-mode dynamic binary translator can help OS and computer architecture developers to trace, debug and replay their program. QEMU is a famous opren source dynamic binary translator. However, system mode QEMU is much slower. So improving performance of system mode QEMU is an important issue. Trace based optimization is one of the core technologies to improve the performance of system mode DBT. And HQEMU is a multi-threaded DBT prototype with trace based optimization. User mode HQEMU can achieve 2.4X speedup over user mode QEMU for SPEC CPU 2006 integer benchmarks. But in system-mode, HQEMU achieves small speedup over QEMU. In this thesis, we found that directly applying user mode trace based optimization to system mode HQEMU will get poor performance improvement. And we identify the problems of original system mode HQEMU by our experiment and profile results. We provide two optimizations for system mode HQEMU to solving the problems of original system mode HQEMU : 1. Per-process trace request queue 2. Sinking slow path code of softMMU. After integrating our optimizations into system mode HQEMU, system mode HQEMU achieves 1. 16X speedup over system mode QEMU on SPEC CPU 2006 integer benchmark , and achieves 1.62X speedup over system mode QEMU on nBench benchmark.

參考文獻


[2] Ding-Yong Hong, Chun-Chen Hsu, Pen-Chung Yew, Jan-Jan Wu, Wei-Chung Hsu, Pangfeng Liu, Chien-Min Wang, and Yeh-Ching Chung. Hqemu: A multi-threaded and retargetable
[4] Spec benchmarks. http://www.spec.org.
[1] Daniel Bartholomew. Qemu: A multihost, multitarget emulator. Linux J., 2006(145):3–, May 2006.
dynamic binary translator on multicores. In Proceedings of the Tenth International Symposium on Code Generation and Optimization, CGO ’12, pages 104–113, New York, NY, USA, 2012. ACM.
[3] Chris Lattner and Vikram Adve. Llvm: A compilation framework for lifelong program analysis & transformation. In Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization, CGO ’04, pages 75–, Washington, DC, USA, 2004. IEEE Computer Society.

延伸閱讀