Top Banner
Colorama: Architectural Support for Data-Centric Synchronization Luis Ceze, Pablo Montesinos, Christoph von Praun ! and Josep Torrellas HPCA, February 2007 http://iacoma.cs.uiuc.edu University of Illinois at Urbana-Champaign ! IBM Research
125

Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Mar 23, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Colorama: Architectural Support for

Data-Centric Synchronization

Luis Ceze, Pablo Montesinos,

Christoph von Praun! and Josep Torrellas

HPCA, February 2007

http://iacoma.cs.uiuc.edu

University of Illinois at Urbana-Champaign!IBM Research

Page 2: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

2

Page 3: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

2

Page 4: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

•Lock-based synchronization:

• coarse-grain: low performance; fine-grain: error-prone

2

Page 5: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

•Lock-based synchronization:

• coarse-grain: low performance; fine-grain: error-prone

•Transactional Memory-based synchronization:

• programmability ~ coarse-grain locking; performance ~ fine-grain locking

2

Page 6: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

•Lock-based synchronization:

• coarse-grain: low performance; fine-grain: error-prone

•Transactional Memory-based synchronization:

• programmability ~ coarse-grain locking; performance ~ fine-grain locking

•Locks and TM shortcoming:

• programmer needs to annotate code around every potential access to

shared data

2

Page 7: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

•Lock-based synchronization:

• coarse-grain: low performance; fine-grain: error-prone

•Transactional Memory-based synchronization:

• programmability ~ coarse-grain locking; performance ~ fine-grain locking

•Locks and TM shortcoming:

• programmer needs to annotate code around every potential access to

shared data

2

Need to make parallel programming much simpler:

Page 8: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Challenge: Simplify Parallel Programming

•Thread synchronization is very challenging

•Lock-based synchronization:

• coarse-grain: low performance; fine-grain: error-prone

•Transactional Memory-based synchronization:

• programmability ~ coarse-grain locking; performance ~ fine-grain locking

•Locks and TM shortcoming:

• programmer needs to annotate code around every potential access to

shared data

2

Need to make parallel programming much simpler:

"Data-Centric Synchronization (DCS)

Page 9: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

Colorama: Data-Centric

Synchronization (DCS)

Page 10: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

declare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 11: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

A B Cdeclare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 12: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

A B Cdeclare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 13: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

A B Cdeclare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 14: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 15: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 16: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C declare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 17: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C declare A,B,C

Colorama: Data-Centric

Synchronization (DCS)

Page 18: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

Page 19: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

color blue C

Page 20: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

color blue C

Page 21: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

ld A

st A

st B

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

color blue C

Page 22: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

ld A

st A

st B

ld C

st C

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

color blue C

Page 23: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

A B C

Luis Ceze Colorama February 2007

Conventional: Code-Centric

Synchronization (CCS)

3

lock L1ld A

st A

st B

unlock L1

lock L2ld C

st C

unlock L2

ld A

st A

st B

ld C

st C

System infers and

enforces critical sections

A B Cdeclare A,B,C declare A,B,C

color red A,B

Colorama: Data-Centric

Synchronization (DCS)

color blue C

Page 24: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

DCS Reduces Programmer Effort

4

Page 25: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

DCS Reduces Programmer Effort

4

code-centric data-centric

Page 26: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

DCS Reduces Programmer Effort

4

code-centric data-centric

reasoning non-local local

Page 27: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

DCS Reduces Programmer Effort

4

code-centric data-centric

reasoning non-local local

critical

sectionsexplicitly

defined

inferred by

system

Page 28: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

DCS Reduces Programmer Effort

4

code-centric data-centric

reasoning non-local local

critical

sectionsexplicitly

defined

inferred by

system

"Intuition: Local reasoning improves programmer

productivity by reducing chances of mistakes

Page 29: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Example from mysql

5

Page 30: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Example from mysql

5

header

info

Page 31: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

• all header protected by global lock

• global lock used in 29 sites

Luis Ceze Colorama February 2007

Example from mysql

5

header

info

Page 32: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

• all header protected by global lock

• global lock used in 29 sites

•info protected by per-record lock

• per-record lock used in 14 sites

Luis Ceze Colorama February 2007

Example from mysql

5

header

info

Page 33: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

CCS

• all header protected by global lock

• global lock used in 29 sites

•info protected by per-record lock

• per-record lock used in 14 sites

Luis Ceze Colorama February 2007

Example from mysql

5

header

info

Page 34: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

CCS

• all header protected by global lock

• global lock used in 29 sites

•info protected by per-record lock

• per-record lock used in 14 sites

•header fields same color

• each info different color

DCS

Luis Ceze Colorama February 2007

Example from mysql

5

header

info

Page 35: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Software DCS

6

Page 36: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Software DCS

•Software-only DCS concurrently developed [Vaziri PoPL’06]

• for object-oriented languages (Java)

6

Page 37: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Software DCS

•Software-only DCS concurrently developed [Vaziri PoPL’06]

• for object-oriented languages (Java)

•Needs whole-program analysis

6

Page 38: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Software DCS

•Software-only DCS concurrently developed [Vaziri PoPL’06]

• for object-oriented languages (Java)

•Needs whole-program analysis

•Impractical in C/C++

• Pointer aliasing

• Compiler often does not have access to whole code

6

Page 39: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

7

Page 40: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

7

Page 41: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

7

Page 42: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

7

Page 43: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

7

Page 44: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

•Exit critical section using an Exit Policy

7

Page 45: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

•Exit critical section using an Exit Policy

• HW provides flexible primitives to exit critical sections

7

Page 46: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

•Exit critical section using an Exit Policy

• HW provides flexible primitives to exit critical sections

• Compiler inserts the code that implements the policy

7

Page 47: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

•Exit critical section using an Exit Policy

• HW provides flexible primitives to exit critical sections

• Compiler inserts the code that implements the policy

• Programmer must know (and follow) the Exit Policy

7

Page 48: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama: Architecture Support for DCS

•Main advantage: HW can cheaply watch all memory refs

•Enter critical section when colored data is touched

• HW checks the color of every memory access

• Interface to assign colors to shared data (memory tagging)

•Exit critical section using an Exit Policy

• HW provides flexible primitives to exit critical sections

• Compiler inserts the code that implements the policy

• Programmer must know (and follow) the Exit Policy

•Structures to keep track of color ownership

7

Page 49: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Architecture Components

8

Page 50: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Start

Address

End

Address ColorID

Palette

Shared

Luis Ceze Colorama February 2007

Architecture Components

8

Page 51: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Start

Address

End

Address ColorID

Palette

Shared Per Thread

Owned Colors Array

Color Acquire Bitmap

Register (CAB)

Color Release Bitmap

Register (CRB)

Thread Color Status

ColorIDi

Luis Ceze Colorama February 2007

Architecture Components

8

Page 52: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

Palette

Owned Colors

Array

Page 53: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

color A red

color B red

color C red

color E blue

color F blue

Palette

Owned Colors

Array

Page 54: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

Owned Colors

Array

Page 55: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

Owned Colors

Array

thread 1

Page 56: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

Owned Colors

Array

thread 1

Page 57: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

Owned Colors

Array

thread 1

Page 58: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

Owned Colors

Array

red

thread 1

Page 59: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

Owned Colors

Array

red

thread 1

Page 60: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

Owned Colors

Array

red

thread 1

Page 61: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

red

thread 1

Page 62: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

thread 1

Page 63: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

thread 1

Page 64: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

st E

st F

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

blue

!trap to user-level handler, start blue critical section

thread 1

Page 65: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

st E

st F

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

blue

!trap to user-level handler, start blue critical section

!trap to user-level handler, exit blue critical section

thread 1

Page 66: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

st E

st F

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

!trap to user-level handler, start blue critical section

!trap to user-level handler, exit blue critical section

thread 1

Page 67: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

st E

st F

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

!trap to user-level handler, start blue critical section

!trap to user-level handler, exit blue critical section

thread 1

inferred critical

sections

Page 68: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Colorama Operation Example

9

ld A

st B

st C

st E

st F

color A red

color B red

color C red

color E blue

color F blue

Palette

A red

B red

C red

E blue

F blue

!trap to user-level handler, start red critical section

!trap to user-level handler, exit red critical section

Owned Colors

Array

!trap to user-level handler, start blue critical section

!trap to user-level handler, exit blue critical section

thread 1

inferred critical

sections

Underlying synchronization substrate:

TM or locks. Focusing on TM.

Page 69: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exiting a Critical Section

10

Page 70: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exiting a Critical Section

•Knowing when to end a critical section is difficult

10

Page 71: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exiting a Critical Section

•Knowing when to end a critical section is difficult

•Optimal place undecidable

10

Page 72: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exiting a Critical Section

•Knowing when to end a critical section is difficult

•Optimal place undecidable

•Solution is to rely on an agreed Exit Policy

• Exit Policy becomes part of the programming model

10

Page 73: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exiting a Critical Section

•Knowing when to end a critical section is difficult

•Optimal place undecidable

•Solution is to rely on an agreed Exit Policy

• Exit Policy becomes part of the programming model

•We use:

• Return of subroutine where the critical section started [Vaziri’06, Wang’06]

10

Page 74: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exit Policy

11

Page 75: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exit Policy

11

void foo1()

{

...

...

A = ...

...

...

...

}

ColorIDA

critical

section

Page 76: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exit Policy

11

void foo1()

{

...

...

A = ...

...

...

...

}

ColorIDA

critical

section

void foo1()

{

...

...

A = ...

...

...

B = ...

...

...

}

ColorIDA

critical

sectionColorID

B

critical

section

Page 77: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Exit Policy

11

void foo1()

{

...

...

A = ...

...

...

...

}

ColorIDA

critical

section

void foo1()

{

...

A = ...

foo2();

...

}

void foo2()

{

...

B = ...

...

}

ColorIDA

critical

section

ColorIDB

critical

section

void foo1()

{

...

...

A = ...

...

...

B = ...

...

...

}

ColorIDA

critical

sectionColorID

B

critical

section

Page 78: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Start

Address

End

Address ColorID

Palette

Shared Per Thread

Owned Colors Array

Color Acquire Bitmap

Register (CAB)

Color Release Bitmap

Register (CRB)

Thread Color Status

ColorIDi

Luis Ceze Colorama February 2007

Architecture Components

12

Page 79: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()Color Acquire Bitmap

(CAB register)Owned Colors

Array

Page 80: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()Color Acquire Bitmap

(CAB register)

ld Z

Owned Colors

Array

Page 81: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()Color Acquire Bitmap

(CAB register)

1ld Z

Owned Colors

Array

Blue

Page 82: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

Color Acquire Bitmap

(CAB register)

1ld Z

Owned Colors

Array

Blue

Page 83: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

Color Acquire Bitmap

(CAB register)

1ld Z

stack " CAB

Owned Colors

Array

Blue

Page 84: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

Color Acquire Bitmap

(CAB register)

1ld Z

stack " CAB

CAB " 0

Owned Colors

Array

Blue

Page 85: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

Color Acquire Bitmap

(CAB register)

ld Z

stack " CAB

CAB " 0

Owned Colors

Array

Blue

Page 86: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

Color Acquire Bitmap

(CAB register)

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

Blue

Page 87: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

Color Acquire Bitmap

(CAB register)

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

Blue

Page 88: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

Blue

Red

Page 89: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

ld T

Blue

Red

Page 90: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

ld B

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

ld T

Blue

Red

Page 91: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0...

Owned Colors

Array

ld T

Blue

Red

Green

Page 92: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0

...

...

Owned Colors

Array

ld T

Blue

Red

Green

Page 93: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

...

...

Owned Colors

Array

ld T

Blue

Red

Green

Page 94: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB ! exits critical sections Red and Green

...

...

Owned Colors

Array

ld T

Blue

Red

Green

Page 95: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB ! exits critical sections Red and Green

...

...

Owned Colors

Array

ld T

Blue

Page 96: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

1

Color Acquire Bitmap

(CAB register)

1

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

CAB " stack

! exits critical sections Red and Green

...

...

Owned Colors

Array

ld T

Blue

Page 97: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

Color Acquire Bitmap

(CAB register)

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

CAB " stack

! exits critical sections Red and Green

1

...

...

Owned Colors

Array

ld T

Blue

Page 98: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

Color Acquire Bitmap

(CAB register)

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

CAB " stack

! exits critical sections Red and Green

...

ret

1

...

...

Owned Colors

Array

ld T

Blue

Page 99: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

Color Acquire Bitmap

(CAB register)

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

CAB " stack

! exits critical sections Red and Green

...

ret

1

...

...

subroutine prologue/epilogue

inserted by the compiler

Owned Colors

Array

ld T

Blue

Page 100: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Detailed Operation

13

f()

call g()

ld A

Color Acquire Bitmap

(CAB register)

ld B

ld Z

stack " CAB

CAB " 0

CRB " CAB

CAB " stack

! exits critical sections Red and Green

...

ret

1

...

...

subroutine prologue/epilogue

inserted by the compiler

Owned Colors

Array

ld T

Blue

Hardware is generic: exit policy

configurable and specified by SW.

Page 101: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Protection

Lookaside

Buffer (PLB)

Processor

Multilevel

Permissions

Table

Memory

MMP with the Palette extensions

Luis Ceze Colorama February 2007

Palette Implementation

14

Mondrian Memory Protection [Witchel ASPLOS’02]

Page 102: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

15

Page 103: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

15

Page 104: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

•Conveys more information on how shared data is used

15

Page 105: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

•Conveys more information on how shared data is used

• Allows future exit policy refinement

15

Page 106: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

•Conveys more information on how shared data is used

• Allows future exit policy refinement

• More opportunity for optimizations

15

Page 107: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

•Conveys more information on how shared data is used

• Allows future exit policy refinement

• More opportunity for optimizations

• e.g., assume transactions of different colors do not collide

15

Page 108: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Why Multiple Colors?

•Intuitive way of nesting inferred transactions

•Conveys more information on how shared data is used

• Allows future exit policy refinement

• More opportunity for optimizations

• e.g., assume transactions of different colors do not collide

•Lock-based implementation: each color maps to a lock

15

Page 109: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

16

Page 110: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

•Programmer uses explicit transactions AND colors data

16

Page 111: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

•Programmer uses explicit transactions AND colors data

•The system can monitor:

16

Page 112: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

•Programmer uses explicit transactions AND colors data

•The system can monitor:

" colored data should only be accessed inside transactions

16

Page 113: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

•Programmer uses explicit transactions AND colors data

•The system can monitor:

" colored data should only be accessed inside transactions

" transactions of different colors should not collide

16

Page 114: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Using Colorama to Debug Conventional Code

•Programmer uses explicit transactions AND colors data

•The system can monitor:

" colored data should only be accessed inside transactions

" transactions of different colors should not collide

" transactions should typically access a single color

- if multiple colors are accessed, nesting could be recommended

16

Page 115: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Evaluation

17

Page 116: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Evaluation

•No large Colorama programs (yet)

17

Page 117: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Evaluation

•No large Colorama programs (yet)

•Evaluation consists in detailed profiling of open-source

parallel programs

• Developed Pin tool to profile critical sections and memory allocation

• Used MySQL, FireFox, aolserver, tuxracer, ...

17

Page 118: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Evaluation

•No large Colorama programs (yet)

•Evaluation consists in detailed profiling of open-source

parallel programs

• Developed Pin tool to profile critical sections and memory allocation

• Used MySQL, FireFox, aolserver, tuxracer, ...

•Estimated Exit Policy suitability

• Majority of critical sections entry/exit are inside same subroutine

17

Page 119: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Evaluation

•No large Colorama programs (yet)

•Evaluation consists in detailed profiling of open-source

parallel programs

• Developed Pin tool to profile critical sections and memory allocation

• Used MySQL, FireFox, aolserver, tuxracer, ...

•Estimated Exit Policy suitability

• Majority of critical sections entry/exit are inside same subroutine

•Estimated overheads

• Palette increases memory footprint by about 2.5%

17

Page 120: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Also in the paper...

•More examples

•Detailed API

•Lock-based implementation issues

•Code compatibility issues

• conditional wait, linking with non-Colorama code, ...

•Debugging Colorama code

•Additional characterization

18

Page 121: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conclusion

19

Page 122: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conclusion

•We presented a feasible implementation of DCS

19

Page 123: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conclusion

•We presented a feasible implementation of DCS

•DCS can greatly simplify parallel programming

• programmer only specifies the colors and follows a simple policy

• the system, in return, guarantees consistency of shared data

19

Page 124: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Luis Ceze Colorama February 2007

Conclusion

•We presented a feasible implementation of DCS

•DCS can greatly simplify parallel programming

• programmer only specifies the colors and follows a simple policy

• the system, in return, guarantees consistency of shared data

•Current work:

• Other exit policies under investigation

• Deeper evaluation

19

Page 125: Colorama: Ar chitectural Support for Data-Centric Synchr onization · 2007. 9. 14. · Luis Ceze Colorama February 2007 NYV\W Colorama: Ar chitectur e Support for DCS ¥ Main advantage:

Colorama: Architectural Support for

Data-Centric Synchronization

Luis Ceze, Pablo Montesinos,

Christoph von Praun! and Josep Torrellas

HPCA, February 2007

http://iacoma.cs.uiuc.edu

University of Illinois at Urbana-Champaign!IBM Research