32
Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES Davide Cingolani Alessandro Pellegrini Francesco Quaglia High Performance and Dependable Computing Systems Group Sapienza, University of Rome PADS 2015

Transparently Mixing Undo Logs and Software Reversibility for State

  • Upload
    vokhue

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Transparently Mixing Undo Logs and Software Reversibility for State

Transparently Mixing Undo Logs and Software Reversibilityfor State Recovery in Optimistic PDES

Davide CingolaniAlessandro Pellegrini

Francesco Quaglia

High Performance and DependableComputing Systems Group

Sapienza, University of Rome

PADS 2015

Page 2: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj

LPk Execution Time

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 3: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5

LPk Execution Time7

10 Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 4: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5

LPk Execution Time7 17

10

17

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 5: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5 10

20

LPk Execution Time7 17 25

10

17

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 6: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5 10

20

12

LPk Execution Time7 17 25

10

17

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 7: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5 10

20

Straggler Message

12

LPk Execution Time7 17 25

10

17

Rollback Execution:

Recovering state at

LVT 10

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 8: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5 10

20

Straggler Message

12

LPk Execution Time7 17 25

10

17 17

Anti-message

anti-message

reception

Rollback Execution:

Recovering state at

LVT 10

Rollback Execution:

Recovering State at

LVT 7

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 9: Transparently Mixing Undo Logs and Software Reversibility for State

Coordination in PDES

LPi

LPj 15

5 10

20 12

Straggler Message

12

LPk Execution Time7 17 25

10

17

17 17

Anti-message

anti-message

reception

Rollback Execution:

Recovering state at

LVT 10

Rollback Execution:

Recovering State at

LVT 7

Execution Time

Execution Time

2 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 10: Transparently Mixing Undo Logs and Software Reversibility for State

But how to actually rollback?

• State Saving◦ a plethora of different approaches to optimize: CSS, SSS, ISS◦ independent of rollback length◦ can be costly if the state is large or largely accessed

• Reverse Computing◦ a forward event e on a simulation state S produces the transition

e(S)→ S ′

◦ the reverse event r associated with e produces the inverse transitionr(S ′)→ S

◦ execution time can be directly proportional to execution time ofsimulation events and rollback length

◦ what if few portions of S are updated?

3 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 11: Transparently Mixing Undo Logs and Software Reversibility for State

Combining Philosophies: on-the-fly reversibility

• If rollbacking far in the past, use state saving to get “closer”

• Use reversibility—rather than reverse events—to “fine tune” therollback point◦ Undoing only the effects of an event in memory

• Generate undo code blocks on the fly while running forward events◦ Intercept memory updates◦ Generate assembly instructions which undo the effects◦ Store them so that undoing an event can be done quickly

• Use static binary instrumentation to reduce at most the costs

• Don’t pay the instrumentation cost if the undo code block will benever executed

4 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 12: Transparently Mixing Undo Logs and Software Reversibility for State

Combining Philosophies: on-the-fly reversibility

• If rollbacking far in the past, use state saving to get “closer”

• Use reversibility—rather than reverse events—to “fine tune” therollback point◦ Undoing only the effects of an event in memory

• Generate undo code blocks on the fly while running forward events◦ Intercept memory updates◦ Generate assembly instructions which undo the effects◦ Store them so that undoing an event can be done quickly

• Use static binary instrumentation to reduce at most the costs

• Don’t pay the instrumentation cost if the undo code block will benever executed

4 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 13: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 14: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 15: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

restore

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 16: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

reprocess

restore

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 17: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 18: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

restore

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 19: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

undo effects

restore

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 20: Transparently Mixing Undo Logs and Software Reversibility for State

How is then better to rollback?

Wall Clock Time

event checkpoint

rollback point

undo effects

restore

• Then, we must be able to “disable” the generation of undo codeblocks if they are not needed

• This can be done quickly using code multiversioning

5 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 21: Transparently Mixing Undo Logs and Software Reversibility for State

Code Multiversioning

.text

.data

.rodata

.bss

Original Relocatable

Object File

.text_1

.data

.rodata

.bss

.text_2

.data

.rodata

.bss

.text_2

.data

.rodata

.bss

.text_1

Final Relocatable

Object File

First R

ules

Set

Second R

ules Set

6 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 22: Transparently Mixing Undo Logs and Software Reversibility for State

Static Binary Instrumentation

• We rely on Hijacker [HPDC2012] to instrument the simulationmodel’s code

Hijacker

Front-End

Executable Formats

Interpreters

Instruction Sets

Disassemblers

File

Loader

Executable Formats

Generators

Instruction Sets

Assemblers

File

Writer

Back-End

Input

Relocatable

Executable

Output

Relocatable

Executable

XML

Con g

File

XML Parser

Internal Executable

Representation

Instrumentation Rule Manager

Instrumentation Engine

7 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 23: Transparently Mixing Undo Logs and Software Reversibility for State

Hijacker Rules

<hijacker:Rules xmlns:hijacker="http://www.dis.uniroma1.it/~hpdcs/">

<hijacker:Inject file="mixed-state-saving.c" />

<hijacker:Executable suffix="memtrack"> <!-- First code version -->

<hijacker:Instruction type="I_MEMWR">

<hijacker:AddCall where="before" function="reverse_generator"

arguments="target" />

</hijacker:Instruction>

</hijacker:Executable>

<hijacker:Executable suffix="notrack"> <!-- Second code version -->

</hijacker:Executable>

</hijacker:Rules>

8 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 24: Transparently Mixing Undo Logs and Software Reversibility for State

How rules are applied

original m em ory

update

Inst rum entat ion Process

Original Executable Final executable

mov $1, x

push metadata

call monitor

mov $1, x

9 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 25: Transparently Mixing Undo Logs and Software Reversibility for State

Generating negative instructions

• We read the value of the original write before it’s actually executed

• This value is packed within an instruction which writes it back onthe same address

• Some exceptions to this behaviour:◦ cmov: the reverse mov is generated only if cmov is executed◦ movs: a reverse movs is... a movs!

• Opcodes are known beforehand: fast table-driven generation

10 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 26: Transparently Mixing Undo Logs and Software Reversibility for State

Organizing instructions: Reverse Windows

revwinsize

address

pointer

Heap

revwin

Each reverse window is associated with an event(and stored in the associated node)

11 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 27: Transparently Mixing Undo Logs and Software Reversibility for State

Reverse or not reverse? The Decision Model

• Based on an “old” decision model [ParCo2001]

• This model expresses the trade-off between recoverability tasks:

(δs + νδbi )

χ+ Fr

[χ− ν

χ

(δr +

χ− ν − 1

2δe

)+

ν

χ

(δr +

ν

2δb

)]

χ : checkpointing interval

ν : events for which we generate undo code blocks

12 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 28: Transparently Mixing Undo Logs and Software Reversibility for State

How rollback is executed

• Scan the event chain, and identify the point where to rollback

• If the event after the point has a reverse window◦ Restore the first state after that point◦ Process undo code blocks in reverse order

• Otherwise◦ Restore the first state before that point◦ Execute the classical coasting forward

13 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 29: Transparently Mixing Undo Logs and Software Reversibility for State

Experimental Evaluation: Test-bed Environment

• Hardware configuration:◦ HP ProLiant server equipped with 64GB of RAM◦ 4 8-cores CPU (32 cores total)

• Software configuration:◦ ROOT-Sim Optimistic Simulation Kernel, using 32 symmetric WT◦ Debian 6◦ 2.6.32-5-amd64 Linux kernel

• ROOT-Sim configuration:◦ χ set to 10 (changes in the dynamics don’t affect the choice of χ)◦ Portable Communcation System—PCS◦ Varied number of LPs: changes the size of state, memory updates,

and event granularity

14 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 30: Transparently Mixing Undo Logs and Software Reversibility for State

Execution Time: 64 LPs

2

4

6

8

10

12

14

16

18

20

25% 50% 75%

Exe

cutio

n T

ime

(sec

onds

)

Load

ISS SS+CF SS+EU Model

15 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 31: Transparently Mixing Undo Logs and Software Reversibility for State

Execution Time: 1024 LPs

0

20

40

60

80

100

120

140

160

25% 50% 75%

Exe

cutio

n T

ime

(sec

onds

)

Load

ISS SS+CF SS+EU Model

16 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES

Page 32: Transparently Mixing Undo Logs and Software Reversibility for State

Thanks for your attention

Questions?

[email protected]

http://www.dis.uniroma1.it/∼pellegrini

http://www.github.com/HPDCS/ROOT-Sim

17 of 17 - Transparently Mixing Undo Logs and Software Reversibility for State Recovery in Optimistic PDES