Correcting the Dynamic Call Graph Using Control Flow Constraints Byeongcheol (BK) Lee Kevin Resnick Michael Bond Kathryn McKinley UT Austin

1

Motivation 

Complexity of large object oriented programs  



Decompose the program into small methods Method boundary becomes performance-bottleneck

Dynamic interprocedural optimization   

Solve the method boundary problem Inlining and specialization vary the performance by factor of 2 Dynamic call graph (DCG) is critical input! b w 1

a

2

w2

c

Dynamic call graph

Inaccurate call graph

b

1,000

call b

a call c

500

c

DCGSample Error method a

3

Call stack

Timer-based sampling and timing bias

…c

b

cc

b a

cc

b

cc



cc

b a

t

4

Call stack

Timer-based sampling and timing bias

…c

b

cc

b a

cc

b

cc



cc

b a

t

5

Call stack

Timer-based sampling and timing bias

…c

b

cc

b a

cc

b

cc



cc

b a

t

6

Call stack

Timer-based sampling and timing bias

…c

b

cc

b a

cc

b

cc



cc

b a

t

7

Timer-based sampling and timing bias

Call stack

timer tick

…c

timer tick

b

cc

b a

timer tick

cc

b

cc

timer tick



cc

b a

DCGSample

t

8



b 910

b

b 11

1011

c

a 5

c

a 5

c

a 56



b 9991000

c

a 500

Overhead and accuracy in call graph profiling Full instrumentation

Overhead (%)

25 20 15 10 5 0 40

9

Arnold-Grove sampling [2005]

Correction [2007]

Timer-based sampling [2000]

60

80 Accuracy (%)

100

Outline   

10

Motivation Call graph correction Evaluation

Timing bias in SPEC JVM98 raytrace Normalized frequency(%)

Sampling 5

4

3

2

1

0

Method calls grouped by source method

11

Normalized frequency(%)

Timing bias in SPEC JVM98 raytrace

5

4

3

2

1

0

Method calls grouped by source method

12

Correction algorithms 

Detect and correct DCG error 



DCG constraint

Static and dynamic approaches  New

Static FDOM (Frequency dominator) correction  



Dynamic basic block profile correction  

13

Static approach Uses static FDOM constraint on DCG Dynamic approach Uses dynamic basic block profile constraint on DCG

Static FDOM constraint 

FDOM constraint on CFG  

call c is executed at least as many times as call b call c FDOM call b call b



FDOM constraint on DCG 

f( a

c

) ≥ f( a

b

call c

)

method a

14

Static FDOM correction FDOM constraint: f( b 1,000

a

500

c

DCGSample 

c

) ≥ f(

a

b

)

b

Correction

750

c

a 750

DCGFDOMCorrection

Detect error and assign the same average frequency 

15

a



One possible solution to the FDOM constraint Preserve total frequency sum

Dynamic basic block profile constraint 

Some dynamic optimization systems do edge profiling 



Dynamic basic block profile constraint on CFG 



Baseline compiler in Jikes RVM

call b

f(call c) = 2 * f(call b)

Dynamic basic block profile constraint on DCG 

50%

f( a

c

) = 2 * f( a

b

call c

) method a

16

50%

Dynamic basic block profile correction Constraint: f( a

c

b 1,000 500

a

c

DCGSample

fNew( a fNew( a

17

b c

) = 2* f( a

b

) b

Correction

500

a

1,000

c

DCGEdgeProfileCorrection

) = 1/(1+2) * (1,000+500) = 500 ) = 2/(1+2) * (1,000+500) = 1,000

Best result: raytrace Normalized frequency(%)

5

4

3

2

1

0

3

Static FDOM correction 2

5

1

0

Sampling

Normalized frequency(%)

Normalized frequency(%)

5

4

4

3

2

1

0

Dynamic basic block profile correction

18

Outline   

19

Motivation Call graph correction Evaluation

Experimental methodology  

Jikes RVM 2.4.5 on 3.2G Pentium 4 Replay methodology [Blackburn et al. ‘06]   



Deterministic run 1st iteration – compilation + application run 2nd iteration – application run

Measurement 

Accuracy 



Overhead 



20

1st iteration includes call graph correction

Performance 



Use overlap accuracy [Arnold & Grove ’05]

2nd iteration is application-only

SPECJVM98 and DaCapo benchmarks

Accuracy No correction

Static FDOM correction

Dynamic basic block profile correction

100 90

Accuracy(%)

80 70 60 50 40 30 20 10

21

Average

jbb

ipsixql

luindex

jython

hsqldb

fop

bloat

antlr

jack

mtrt

mpegaudio

javac

db

raytrace

jess

compress

0

22 Average

jbb

ipsixql

luindex

jython

hsqldb

fop

bloat

Static FDOM Correction

antlr

jack

mtrt

mpegaudio

javac

db

raytrace

jess

compress

Normalized execution time

Overhead Dynamic basic block profile correction

1.04

1.02

1

0.98

0.96

0.94

0.92

0.9

Inlining performance Static FDOM Correction

Dynamic basic block Profile correction

Perfect DCG

Normalized execution time

1.05

1

0.95

0.9

0.85

23

Average

jbb

ipsixql

luindex

jython

hsqldb

fop

bloat

antlr

jack

mtrt

mpegaudio

javac

db

raytrace

jess

compress

0.8

Baseline: profile-guided inlining with default call graph sampling

Summary   

CFG constraint improves the DCG Inlining has been tuned for bad call graph Advantages Can be easily combined with other DCG profiling  Minimal overhead only during the compilation 



Future work 

24

More inter-procedural optimizations with high accuracy DCG

Question and comment 

25

Thank you!

26

27

28

29

Timing bias misleads optimizer

5,000 times

a

10,000 times

b c

Sampling with timing bias

1,000 samples

a

DCGPerfect



DCGSample 



30

Inliner may inline b instead of c

c

DCGSample

Edge frequencies were reversed!

Inlining decision 

500 samples

b

Call graph profiling in online optimization system Source program

Compile & instrument

Machine code

e.g. Java byte code Dynamic call graph Online optimization system

  

31

Profiling and program run at the same time Minimize profiling overhead Corollary: sacrifice profiling accuracy

Correcting the Dynamic Call Graph Using Control Flow ...

Complexity of large object oriented programs. ❑ Decompose the program into small methods ... FDOM (Frequency dominator) correction. ○. Static approach. ○. Uses static FDOM constraint on DCG. ❑. Dynamic basic block profile correction. ○. Dynamic approach. ○. Uses dynamic basic block profile constraint on DCG.

177KB Sizes 1 Downloads 224 Views

Recommend Documents

Control Flow Integrity Enforcement with Dynamic Code Optimization
We further perform comprehensive evaluations and shed light on the exact amount of savings contributed by ...... ment using randomization for Cloud Computing No. 61373168 and ... The performance cost of shadow stacks and stack canaries.

Control Flow Integrity Enforcement with Dynamic Code Optimization
variants introduced [4, 10, 12, 20, 24–26]. Some of these ..... fair comparison with existing work, we used twelve pure C/C++ programs we can find in SPEC ...

Control Flow Integrity Enforcement with Dynamic ... - Semantic Scholar
We pop out return addresses continuously until a match is found or when the .... 2 does not tell us if the dynamic optimizer had sped up or slowed down the execution of ..... ACM, 2014. 20. V. Pappas, M. Polychronakis, and A. D. Keromytis.

Correcting for Survey Nonresponse Using Variable Response ...
... Department of Political Science, University of Rochester, Rochester, NY 14627 (E-mail: .... the framework, retaining the benefits of poststratification while incorporating a ...... Sample Surveys,” Journal of Marketing Research, 10, 160–168.

FLOW CONTROL Xblock.pdf
Page 2 of 5. For any unit that has FLOW CONTROL: Redirect. condition. Display the. unit's. content. Display. an. HTML. content. Condition. not met. Switch to.

Error Correcting Output Codes Using Genetic Algorithm ...
ing output codes, Genetic algorithm, Multi-layer Per- ceptron (MLP), Support ..... [12] Windeatt, T., Ghaderi, R., Coding and decoding strate- gies for multi-class ...

The dynamic relation between management control ... - IngentaConnect
Eindhoven University of Technology, Eindhoven, The Netherlands and Verdaasdonk Consulting, Best, The Netherlands. Abstract. Purpose – The purpose of this ...

GRAPH CONTROL LYPAUNOV FUNCTION FOR ...
Words are often too little to reveal one's deep regards. This thesis was never an outcome of efforts of a single person. I want to take this opportunity to express my profound sense of gratitude and respect to all those who helped me during the cours

Plot the graph of the equation using ​Desmos​. x
In Desmos, plot the tangent lines to the curve at each of the four points. Then share a ... To get a link, you will need to sign into Desmos using a Google account.

Chapter5-Control Flow Statement.pdf
loop. Iteration. Construct. Whoops! There was a problem loading this page. Chapter5-Control Flow Statement.pdf. Chapter5-Control Flow Statement.pdf. Open.

Plot the graph of the equation using ​Desmos​. x
Names of group members: Plot the graph of the equation using ​Desmos​. x. ) ( + y 2 = x y + 2. ○ What shape does the curve appear to have? The curve ...

Controlling the Flow of Light Using the ... - Stanford University
Nov 11, 2013 - To illustrate the idea we use the model system introduced in Ref. [2] that consists .... We verify the above analytical theory with direct numerical ...

Neurocognitive mechanisms of action control: resisting the call of the ...
K. Richard Ridderinkhof,1∗ Birte U. Forstmann,2 Scott A. Wylie,3. Borıs Burle4 and ..... would cause us to be way too slow to even return the ball, let alone to ...

Queueing behavior under flow control at the subscriber ...
University of Califomia, Los Angeles, Los Angeles, CA 90024. Abstract. A Credit Manager .... analyze the stochastic behavior of the system under the flow control ...

Queueing behavior under flow control at the subscriber-to-network ...
1. Introduction. For many communication networks, conventional end-to-end window flow control schemes ... and the statistical variations of the mixed-services.

Friends Using the Implicit Social Graph - Research at Google
10% of emails are sent to more than one recipient, and over .... with which the user last interacted a year ago. .... to indicate a higher degree of similarity. ..... In Proceedings of Computer Human ... Conference on Computational Science and.

Dynamic Visibility Graph for Path Planning
Dynamic Visibility Graph for Path Planning. Han-Pang Huang* and Shu-Yun Chung+. Robotics Laboratory, Department of Mechanical Engineering. National Taiwan University, Taipei, 10660, TAIWAN. Email: [email protected]. *Professor and correspondence add

Common gateway to call control systems
Jun 13, 2008 - platform supporting the vendor neutral call center integration. FIG. 1B illustrates the use of the system of FIG. 1A in call center integration.

Dynamic quantification of antigen molecules with flow ...
Nov 18, 2015 - After all sampling was completed, the microbeads or cells were ana- ... detectors, and 14 fluorescent detectors utilizing DiVa software (BD.