rethinking the memory hierarchy for modern languages
play

Rethinking the Memory Hierarchy for Modern Languages Po-An Tsai , - PowerPoint PPT Presentation

Rethinking the Memory Hierarchy for Modern Languages Po-An Tsai , Yee Ling Gan, and Daniel Sanchez Memory systems expose an inexpressive interface 2 Memory systems expose an inexpressive interface Program Flat address Arbitrary loads space


  1. Rethinking the Memory Hierarchy for Modern Languages Po-An Tsai , Yee Ling Gan, and Daniel Sanchez

  2. Memory systems expose an inexpressive interface 2

  3. Memory systems expose an inexpressive interface Program Flat address Arbitrary loads space and stores Memory hierarchy 2

  4. Memory systems expose an inexpressive interface 0x0000 Obj. A 0xFFFF Program Obj. B Flat address Arbitrary loads space and stores Memory hierarchy Programmers think of objects and pointers among objects 2

  5. Modern languages expose an object-based memory model Program 0x0000 Obj. A Object-based Object accesses 0xFFFF model Obj. B Runtime/Compiler Flat address Loads and stores space to objects Memory hierarchy  Strictly hiding the flat address space provides many benefits:  Memory safety prevents memory corruption bugs  Automatic memory management (garbage collection) simplifies programming 3

  6. The inexpressive flat address space is inefficient Program Object-based model Runtime/Compiler Flat address space Memory hierarchy 4

  7. The inexpressive flat address space is inefficient Program Object-based model Runtime/Compiler Flat address space Memory hierarchy Semantic gap between programs and the memory hierarchy 4

  8. The inexpressive flat address space is inefficient Program Object-based Main Mem. model 0x0000 Obj. A Obj Runtime/Compiler L1 L2 B Obj. C Flat address Core $ $ space Memory hierarchy 0xFFFF Semantic gap between programs and the memory hierarchy 4

  9. The inexpressive flat address space is inefficient Program Object-based Main Mem. model 0x0000 Obj. A Obj Runtime/Compiler L1 L2 B Obj. C Flat address Core $ $ space Memory hierarchy 0xFFFF Semantic gap between programs and the memory hierarchy Mismatch between objects and cache lines 4

  10. The inexpressive flat address space is inefficient Program Object-based Main Mem. model 0x0000 Obj. A Obj Runtime/Compiler L1 L2 B Obj. C Flat address Core $ $ space Memory hierarchy 0xFFFF Semantic gap between programs and the memory hierarchy Mismatch between Costly associative objects and cache lines lookups 4

  11. Hotpads: An object-based memory hierarchy 5

  12. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it 5

  13. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it Program Object-based ISA Object operations Hotpads Manages objects 5

  14. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it Program Object-based ISA Object operations Hotpads Manages objects L2 L3 L1 Core pad pad pad 5

  15. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it Program Hotpads manages objects instead of cache lines Object-based ISA Object operations Hotpads Manages objects L2 L3 L1 Core pad pad pad 5

  16. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it Program Hotpads manages objects instead of cache lines Object-based ISA Object operations Hotpads Hotpads rewrites pointers to Manages objects reduce associative lookups L2 L3 L1 Core pad pad pad 5

  17. Hotpads: An object-based memory hierarchy  A memory hierarchy designed from the ground up for object-based programs  Provides first-class support for objects and pointers in the ISA  Hides the memory layout from software and takes control over it Program Hotpads manages objects instead of cache lines Object-based ISA Object operations Hotpads Hotpads rewrites pointers to Manages objects reduce associative lookups Hotpads provides architectural L2 L3 L1 Core support for in-hierarchy object pad pad pad allocation and recycling 5

  18. Prior architectural support for object-based programs 6

  19. Prior architectural support for object-based programs  Object-oriented/typed systems [iAPX432, Dally ISCA’85, CHERI ISCA’14, Kim et al. ASPLOS’17] focus on core microarchitecture design Core  Accelerate virtual calls, object references Type check unit L2 and dynamic type checks L1 $ vFunction unit $ 6

  20. Prior architectural support for object-based programs  Object-oriented/typed systems [iAPX432, Dally ISCA’85, CHERI ISCA’14, Kim et al. ASPLOS’17] focus on core microarchitecture design Core  Accelerate virtual calls, object references Type check unit L2 and dynamic type checks L1 $ vFunction unit $  Hardware accelerators for GC [The Lisp Machine, GC unit Joao et al. ISCA’09, Maas et al. ISCA’18] Core L2 L1 $ $ 6

  21. Prior architectural support for object-based programs  Object-oriented/typed systems [iAPX432, Dally ISCA’85, CHERI ISCA’14, Kim et al. ASPLOS’17] focus on core microarchitecture design Core  Accelerate virtual calls, object references Type check unit L2 and dynamic type checks L1 $ vFunction unit $  Hardware accelerators for GC [The Lisp Machine, GC unit Joao et al. ISCA’09, Maas et al. ISCA’18] Core L2 L1 $ $ Prior work uses standard cache hierarchies 6

  22. Prior architectural support for object-based programs  Object-oriented/typed systems [iAPX432, Dally ISCA’85, CHERI ISCA’14, Kim et al. ASPLOS’17] focus on core microarchitecture design Core  Accelerate virtual calls, object references Type check unit L2 and dynamic type checks L1 $ vFunction unit $  Hardware accelerators for GC [The Lisp Machine, GC unit Joao et al. ISCA’09, Maas et al. ISCA’18] Core L2 L1 $ $ Prior work uses standard cache hierarchies We focus on redesigning the memory hierarchy 6

  23. Hotpads overview 7

  24. Hotpads overview L2 L3 L1 Core pad pad pad 7

  25. Hotpads overview  Data array  Managed as a circular buffer using simple L2 L3 L1 Core pad pad bump pointer allocation pad  Stores variable-sized objects compactly Data Array Objects Free space 7

  26. Hotpads overview  Data array  Managed as a circular buffer using simple L2 L3 L1 Core pad pad bump pointer allocation pad  Stores variable-sized objects compactly Data Array Obj. A Objects Free space 7

  27. Hotpads overview  Data array  Managed as a circular buffer using simple L2 L3 L1 Core pad pad bump pointer allocation pad  Stores variable-sized objects compactly Data Array Obj. A Objects Obj. B Free space 7

  28. Hotpads overview  Data array  Managed as a circular buffer using simple L2 L3 L1 Core pad pad bump pointer allocation pad  Stores variable-sized objects compactly  C-Tags Data Array  Decoupled tag store used only for a fraction Obj. A Objects of accesses Obj. B Free space C-Tags 7

  29. Hotpads overview  Data array  Managed as a circular buffer using simple L2 L3 L1 Core pad pad bump pointer allocation pad  Stores variable-sized objects compactly  C-Tags Data Array  Decoupled tag store used only for a fraction (word/object) Obj. A Metadata Objects of accesses Obj. B Free space  Metadata C-Tags  Pointer? valid? dirty? recently-used? 7

  30. Hotpads example 8

  31. Hotpads example class Node { int value; Node next; } 8

  32. Hotpads example class Node { RegFile L1 Pad L2 Pad Main Mem int value; r0 Node next; Objects r1 A } Free r2 B space r3 Initial state. 8

  33. Hotpads moves object implicitly class Node { RegFile L1 Pad L2 Pad Main Mem int value; r0 Node next; r1 A } A r2 B r3 Core issues access to A. Program code: Hotpads instructions: A is copied into L1 pad. int v = A.value; ld r0, (r1).value 9

  34. Hotpads moves object implicitly class Node { RegFile L1 Pad L2 Pad Main Mem int value; r0 Node next; r1 A } A r2 B r3 Core issues access to A. Program code: Hotpads instructions: A is copied into L1 pad. int v = A.value; ld r0, (r1).value  All loads/stores follow a single addressing mode: Base+offset 9

  35. Hotpads moves object implicitly class Node { RegFile L1 Pad L2 Pad Main Mem int value; r0 Node next; r1 A } A r2 B r3 Core issues access to A. Program code: Hotpads instructions: A is copied into L1 pad. int v = A.value; ld r0, (r1).value  All loads/stores follow a single addressing mode: Base+offset  Bump pointer allocation stores A compactly after other objects 9

  36. Hotpads rewrites pointers to avoid associative lookups class Node { RegFile L1 Pad L2 Pad Main Mem int value; r0 Node next; r1 A } A r2 B r3 Core issues access to A. Program code: Hotpads instructions: A is copied into L1 pad. int v = A.value; ld r0, (r1).value r1 is rewritten to A’s L1 pad address. 10

Recommend


More recommend