BabelFish: Fusing Address Translations for Containers Dimitrios Skarlatos, Umur Darbaz, Bhargava Gopireddy, Nam Sung Kim, and Josep Torrellas University of Illinois at Urbana-Champaign skarlat2@illinois.edu ISCA 2020
Conventional Cloud Computing App App Lib Lib Virtual Machines Guest OS Guest OS Hypervisor Hardware 2
New Era in Cloud Computing App App App 1. Lightweight Containers Lib Lib Lib 2. Faster bringup Container Engine Operating System 3. Higher consolidation OS automatically Hardware shares resources! 3
Containers in the Cloud Pod Application Binary Library High number of containers Replicated Containers Container Engine Operating System Very frequent context switches Scalability Hardware Serverless & Fault Tolerance Function-as-a-Service (FaaS) • Cold start effects Load Balancing • Very short runtime Shared Data Pages 4
Problem: Replicated VA à PA Translations Pod Application Binary Library High number of containers Replicated Containers Container Engine 1. TLB thrashing Operating System Very frequent context switches Scalability 2. Redundant page table work Hardware Serverless & Fault Tolerance Function-as-a-Service (FaaS) • Cold start effects Load Balancing • Very short runtime Shared Data Pages 5
Solution: Share VA à PA Translations Pod Application Binary Library High number of containers Replicated Containers Container Engine 1. Minimize TLB thrashing Operating System Very frequent context switches Scalability 2. Eliminate redundant page table work Hardware Serverless & Fault Tolerance Function-as-a-Service (FaaS) • Cold start effects Load Balancing • Very short runtime Shared Data Pages 6
Contribution: BabelFish HW and OS support to share translations across containers 1. Introduce Container Context IDentifiers (CCID) 2. Extend TLB design 3. Share page tables Performance improvement Data-serving: 11%-18% Compute: 11% Function-as-a-Service: 10-55% Container bring-up: 8% “The Babel fish is small, yellow, leech-like, and probably the oddest thing in the Universe. The practical upshot of all this is that if you stick a Babel fish in your ear you can instantly understand anything said to you in any form of language.” The Hitchhiker's Guide to the Galaxy – Douglas Adams 7
Problem: TLB Bloat Main Memory Container A PA 4 Page Tables A VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB 8
Problem: TLB Bloat Main Memory Container A PA 4 Page Tables A VA 1 PA 4 VA1 PA4 L1 L2 L3 Core Cache Cache Cache Issue LD VA 1 TLB TLB Miss à “Page Walk” = Fetch entry from page table 9
Problem: TLB Bloat Main Memory Container A PA 4 Page Tables A VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB VA1 PA4 PCID Existing Process Context IDentifiers (PCID) 10
Problem: TLB Bloat Main Memory Container B PA 4 Page Tables B VA 1 PA 4 VA1 PA4 L1 L2 L3 Core Cache Cache Cache Issue LD VA 1 TLB VA1 PA4 PCID PCID VA1 PA4 What if we could identify shared entries? TLB Miss à “Page Walk” = Fetch entry from page table 11
Problem: TLB Bloat Main Memory Container B PA 4 Page Tables B VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB PA4 VA1 VA1 PA4 What if we could identify shared entries? 12
Solution: BabelFish TLB Main Memory Container Context Identifier (CCID) Container A Container B PA 4 Page Tables B VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB PA4 CCID VA1 VA1 PA4 Unlimited sharing of translations among any number of containers! 13
Solution: BabelFish TLB Main Memory Container Context Identifier (CCID) Container A Container B Container C PA 4 Page Tables B VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB PrivateCopy (PC) PA4 CCID PC VA1 VA1 PA4 VA à PA shared for some containers & private for others 14
Solution: BabelFish TLB Main Memory Container Context Identifier (CCID) Container A Container B Container C PA 4 Page Tables B VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache TLB PrivateCopy (PC) PA4 CCID PC VA1 VA1 PA4 VA à PA shared for some containers VA1 PA6 CCID PC & private for others 15
Problem: Page Table Entry Bloat Main Memory Container A PA 4 Page Tables A VA 1 PA 4 VA 1 PA 4 VA 1 PA 4 VA1 PA4 L1 L2 L3 Core Cache Cache Cache TLB VA1 PA4 PCID 16
Problem: Page Table Entry Bloat Main Memory Container B PA 4 Page Tables A VA 1 PA 4 VA 1 PA 4 VA 1 PA 4 L1 L2 L3 Core Cache Cache Cache VA 1 PA 4 VA 1 PA 4 Page Tables B TLB VA 1 PA 4 VA1 PA4 VA1 PA4 PCID VA1 PA4 PCID 17
Problem: Lazy Page Table Management Main Memory Container A PA 4 Present bit Page Tables A VA 1 PA 4 P L1 L2 L3 Core Cache Cache Cache Page Tables B TLB VA 1 PA 4 P 18
Problem: Lazy Page Table Management Main Memory Container A Present bit currently cleared PA 4 Page Tables A VA 1 PA 4 P L1 L2 L3 Core Cache Cache Cache Page Tables B TLB VA 1 PA 4 P 19
Problem: Lazy Page Table Management Main Memory Container A Page Tables A VA 1 PA 4 P P VA1 PA4 L1 L2 L3 Core Cache Cache Cache Issue LD VA 1 Page Tables B TLB VA 1 PA 4 P PA 4 Page Fault! Storage 20
Problem: Lazy Page Table Management Main Memory Present bit set Container A PA 4 Present bit remains cleared Page Tables A P VA 1 PA 4 P L1 L2 L3 Core Cache Cache Cache Issue LD VA 1 Page Tables B TLB VA 1 PA 4 P Page Fault! Storage 21
Problem: Lazy Page Table Management Main Memory Present bit set Container B PA 4 Page Tables A P VA 1 PA 4 P L1 L2 L3 Core Cache Cache Cache Issue LD VA 1 Page Tables B TLB VA 1 PA 4 P P P VA1 PA4 Page Fault! 22
Conventional Page Tables Virtual Address 47 … 39 38 … 30 29 … 21 20 … 12 11 … 0 9-bits 9-bits 9-bits 9-bits 12-bits Container A + + CR3 0 pmd _t + pte_t To TLB + PGD PUD PMD PTE 23
Conventional Page Tables Virtual Address 47 … 39 38 … 30 29 … 21 20 … 12 11 … 0 9-bits 9-bits 9-bits 9-bits 12-bits Container A + + CR3 0 pmd _t + pte_t To TLB + PGD Container B PUD PMD PTE + CR3 1 + + pmd_t To TLB pte_t + PGD PUD PMD PTE 24
Conventional Page Tables Virtual Address 47 … 39 38 … 30 29 … 21 20 … 12 11 … 0 9-bits 9-bits 9-bits 9-bits 12-bits Container A + + CR3 0 pmd _t + pte_t To TLB + PGD Container B PUD PMD PTE + CR3 1 + + pmd_t To TLB pte_t + PGD PUD PMD PTE 25
Solution: BabelFish Page Table Sharing Virtual Address 47 … 39 38 … 30 29 … 21 20 … 12 11 … 0 9-bits 9-bits 9-bits 9-bits 12-bits Container A + + CR3 0 pmd _t + pte_t To TLB PGD Container B PUD + PMD PTE + CR3 1 + + pmd_t PGD PUD PMD 26
Example Container A: Runs on Core 0, requests VA à PA Container B: Runs on Core 1, requests VA à PA Container C: Runs on Core 0, requests VA à PA 28
Example Page Walk Cache (PWC) Time Conventional Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 0 Miss Miss Miss Walk Walk Walk Walk Fault L2 Cache Miss, L3 Cache Miss, Main Memory Hit 29
Example Time Conventional Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 0 Miss Miss Miss Walk Walk Walk Walk Fault Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 1 Miss Miss Miss Walk Walk Walk Walk Fault 30
Example Time Conventional Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 0 Miss Miss Miss Walk Walk Walk Walk Fault Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 1 Miss Miss Miss Walk Walk Walk Walk Fault PGD PUD PMD PTE Page Issue LD V1 L1 TLB L2 TLB PWC Walk Walk Walk Walk Fault Core 0 Miss Miss Miss 31
Example Time Conventional Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 0 Miss Miss Miss Walk Walk Walk Walk Fault Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 1 Miss Miss Miss Walk Walk Walk Walk Fault PGD PUD PMD PTE Page Issue LD V1 L1 TLB L2 TLB PWC Walk Walk Walk Walk Fault Core 0 Miss Miss Miss Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page BabelFish Core 0 Miss Miss Miss Walk Walk Walk Walk Fault 32
Example Time Conventional Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 0 Miss Miss Miss Walk Walk Walk Walk Fault Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page Core 1 Miss Miss Miss Walk Walk Walk Walk Fault PGD PUD PMD PTE Page Issue LD V1 L1 TLB L2 TLB PWC Walk Walk Walk Walk Fault Core 0 Miss Miss Miss Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Page BabelFish Core 0 Miss Miss Miss Walk Walk Walk Walk Fault Issue LD V1 L1 TLB L2 TLB PWC PGD PUD PMD PTE Walk Walk Walk Core 1 Miss Miss Miss Walk L2 Cache Miss, L3 Cache Hit 33
Recommend
More recommend