dynamo 100107092845-phpapp02

21
みよし たけふみ 2009. 12. 02 201018日金曜日

Upload: takefumi-miyoshi

Post on 05-Dec-2014

525 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Dynamo 100107092845-phpapp02

みよし たけふみ2009. 12. 02

2010年1月8日金曜日

Page 2: Dynamo 100107092845-phpapp02

概要

• Dynamoの設計と実装を説明するよ

• ソフトウェアの動的最適化システム

• 実プロセッサと透過的にネイティブコードを実行可能

• more challengingなsituationで評価してみたよ

• -O最適化なコードがDynamoで-O4相当に

• HP PA-8000, HPUX10.20 OS

2010年1月8日金曜日

Page 3: Dynamo 100107092845-phpapp02

背景

• ’00な近年では、従来のメカニズムの有効性が低下

• オブジェクト指向言語

• コンパイル時の静的な最適化が不可能に

• Shrink-wrapped software (as a collection of DLLs)

• 動的コード生成環境(Java JIT/動的バイナリ変換)

• 複雑性はハードからソフトへ

• CISC→RISC→VLIW

2010年1月8日金曜日

Page 4: Dynamo 100107092845-phpapp02

Dynamoとは• 1996にHP Lab.ではじまったプロジェクト

• dynamic optimization system (ネイティブ命令列)

• すべてはSoftwareで実装されている

• transparent

• コンパイラによる準備(preparatory)なし

• programmer assistanceの必要性なし

• legachyなコードでさえも大丈夫

• 最適化コンパイラ/JITなコードも入力となりえる

2010年1月8日金曜日

Page 5: Dynamo 100107092845-phpapp02

details available in...?

2010年1月8日金曜日

Page 6: Dynamo 100107092845-phpapp02

関連研究との比較

• JIT(Self, Smaltalk-80, Java)

• selective dynamic compilation

• user annotation

• language extensions

• non-native system emulation

• offline binary translation

• superscalar microprocessor

• trace cache

2010年1月8日金曜日

Page 7: Dynamo 100107092845-phpapp02

Cited by 189

0

10

20

30

40

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009

#. Cites

2010年1月8日金曜日

Page 8: Dynamo 100107092845-phpapp02

2009年の文献• Efe Yardimci et al., Mostly static program partitioning of binary executables

• Ryan W. Moore et al., Addressing the challenges of DBT for the ARM architecture

• Borys J. Bradel et al., A study of potential parallelism among traces in Java programs

• Tobias Werth et al., Dynamic code footprint optimization for the IBM Cell Broadband Engine

• Seung Woo Son et al., A compiler-directed data prefetching scheme for chip multiprocessors

• Kim Hazelwood et al., Scalable support for multithreaded applications on dynamic binary instrumentation systems

• Mason Chang et al., Tracing for web 3.0: trace compilation for the next generation web applications

• Andreas Gal et al., Trace-based just-in-time type specialization for dynamic languages

• Florian Brandner, Precise simulation of interrupts using a rollback mechanism

• Jason Mars et al., Scenario Based Optimization: A Framework for Statically Enabling Online Optimizations

• Jianjun Li et al., An Evaluation of Misaligned Data Access Handling Mechanisms in Dynamic Binary Translation Systems

• Naveen Kumar et al., Transparent Debugging of Dynamically Optimized Code

• Alessandro Pellegrini et al., Di-DyMeLoR: Logging only Dirty Chunks for Efficient Management of Dynamic Memory Based Optimistic Simulation Objects

• Daniel Williams et al., Using program metadata to support SDT in object-oriented applications

• Carl Friedrich Bolz et al., Tracing the meta-level: PyPy's tracing JIT compiler

2010年1月8日金曜日

Page 9: Dynamo 100107092845-phpapp02

論文の構成

• Overview of how Dynamo works

• Dynamo’s startup mechanism

• ホットコード選択、最適化、コード生成

• 最適化コードのリンク

• 最適化コードのストレージの管理

• シグナルハンドリング

• 実験と評価

2010年1月8日金曜日

Page 10: Dynamo 100107092845-phpapp02

Overview

Dynamo only interprets the inst. stream until a “hot” inst. seq. is identified.

Dynamo generates an optimized ver. of the trace(fragment) into a software code cache(fragment cache).

2010年1月8日金曜日

Page 11: Dynamo 100107092845-phpapp02

Startup and Initialization

2010年1月8日金曜日

Page 12: Dynamo 100107092845-phpapp02

Fragment Formation

• Trace Selection

• not accuracy, but predictability

• the amount of counter updates and counter storage

• interpretation

• Trace Optimization

• fall-through direction remains on the trace

• Fragment code generation

• emitting the fragment body

• emitting the fragment exit stubs

2010年1月8日金曜日

Page 13: Dynamo 100107092845-phpapp02

Trace Selection

• interpretation > statistical PC sampling

• MRET to pick hot traces

2010年1月8日金曜日

Page 14: Dynamo 100107092845-phpapp02

Trace Optimization

2010年1月8日金曜日

Page 15: Dynamo 100107092845-phpapp02

Fragment Linking

2010年1月8日金曜日

Page 16: Dynamo 100107092845-phpapp02

Fragment Cache Management

• 高いペナルティなしで周期的にCold Tracesを取り除く発見的手法

• Dynamoがfragment creation rateのsharpな増加を認識したときに、キャッシュをフラッシュ

• fragmentに関連づけられたFreeなObjectに対するGC

を提供する副作用的な効果も

2010年1月8日金曜日

Page 17: Dynamo 100107092845-phpapp02

Fragment Cache Management

2010年1月8日金曜日

Page 18: Dynamo 100107092845-phpapp02

Signal Handling

• 最適化fragment実行中にSignalがきたら問題

• signalのインターセプト/制御化での実行

• fragmentコードが実行されないようリンクを切る

• Prototype

• Conservative/Aggressive

2010年1月8日金曜日

Page 19: Dynamo 100107092845-phpapp02

Speedup ratio150kB fragment cache

startup overhead

the lack of stable working set2010年1月8日金曜日

Page 20: Dynamo 100107092845-phpapp02

Bailing-out

bail-outしたらオーバヘッドは0になる

2010年1月8日金曜日

Page 21: Dynamo 100107092845-phpapp02

高い最適化オプション

2010年1月8日金曜日