Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
Predictable Communication and Migration in the Quest-V Separation Kernel
Ye Li, Richard West, Zhuoqun Cheng, Eric Missimer
Boston University
1 / 29
Predictable Communication and Migration in the Quest-V Separation - - PowerPoint PPT Presentation
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions Predictable Communication and Migration in the Quest-V Separation Kernel Ye Li, Richard West, Zhuoqun Cheng, Eric Missimer Boston University 1 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
Boston University
1 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V Separation Kernel [WMC’13, VEE’14]
◮ System is partitioned into a collection of sandboxes ◮ Each sandbox encapsulates one or more CPU cores,
◮ Like a distributed system on a chip ◮ Explicit communication channels b/w sandboxes for data
◮ Useful in safety-critical systems where component failures
2 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V uses H/W virtualization for resource partitioning ◮ Each partition, or sandbox, manages its resources w/o
◮ cf. (RT)-Xen, XtratuM, PikeOS, WindRiver/Mentor
◮ Hypervisor typically only needed for bootstrapping system
◮ Eliminates costly hypervisor traps
◮ ∼1500 clock cycles VM-Exit/Enter Xeon E5506 3 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
4 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Multi-threaded apps may need to communicate ◮ Threads may need to be migrated between sandboxes
◮ for load balancing, schedulability, resource affinity
◮ How do we guarantee predictable communication? ◮ How do we migrate threads w/o violating service
◮ of migrating threads? ◮ of threads in destination sandbox?
◮ Complicated by each sandbox having own local scheduler
5 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ VCPUs for budgeted real-time execution of threads and
◮ Threads mapped to VCPUs ◮ VCPUs mapped to physical cores
◮ Sandbox kernels perform scheduling on assigned cores
◮ Avoid VM-Exits to Monitor – eliminate cache/TLB
6 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
7 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ VCPUs are divided into two classes:
◮ Main VCPUs for conventional tasks ◮ I/O VCPUs for I/O event threads (e.g. ISRs)
◮ See RTAS’11 for more details ◮ In this work focus is on Main VCPUs
◮ Implement Sporadic Server policy ◮ C budget every T period 8 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Inter-sandbox communication in Quest-V relies on
◮ Monitors update EPT mappings to establish private
◮ The lack of both a global clock and global scheduler
9 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ A comms channel is half duplex w/ capacity B bytes ◮ A sender thread (τs) is mapped to a VCPU Vs with
◮ A receiver thread (τr) is mapped to a VCPU Vr with
◮ τs sends an N-byte msg at δs time units per byte ◮ τr replies with an M-byte msg at δr time units per byte ◮ Before replying, τr consumes K units of processing time ◮ What is the worst case round-trip comms delay ∆WC?
10 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Case 1: All messages fit in one channel slot (M, N ≤ B)
11 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ 5 different experiments to predict the worst-case
◮ Core i5-2500K 4-core CPU, 8GB RAM ◮ M = N = B = 4KB, δs, δr calculated w/ caches disabled
Case # Sender VCPU Receiver VCPU Case 1 20/100 2/10 Case 2 20/100 20/100 Case 3 20/100 20/130 Case 4 20/100 20/200 Case 5 20/100 20/230
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Case1 Case2 Case3 Case4 Case5 x100m CPU Cycles Observed Predicted
12 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Case 2: One way communication and messages take
◮ Can be used to estimate address space transfer delay
WC(N) = ⌈ N B ⌉ · (S(B) + (Ts − Cs) + R(B, 0) + (Tr − Cr))
13 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ One-way communication experiments to send 4MB
◮ N = 4MB, M = 0, B = 4KB
Case # Sender VCPU Receiver VCPU Case 1 20/50 20/50 Case 2 10/100 10/100 Case 3 10/100 10/50 Case 4 10/100 10/200 Case 5 5/100 5/130 Case 6 10/200 10/200
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Case1 Case2 Case3 Case4 Case5 Case6 x1000billion CPU Cycles Observed Predicted
14 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V supports the migration of VCPUs and associated
◮ To balance loads across sandboxes ◮ To guarantee the schedulability of VCPUs and threads ◮ For closer proximity to needed resources such as I/O
15 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V predictable migration interface:
◮ The migration function is non-blocking ◮ flag can be set to MIG STRICT, MIG RELAX, or 0
16 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ If VCPU Vm issues a migration request with MIG STRICT
◮ Em is the relative time of the next event for VCPU Vm,
◮ ∆mig is the migration cost
17 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Transfer a thread’s address space and VCPU information
◮ An estimate of the worst-case migration cost requires:
◮ The execution time (δf ) and cost (∆f ) of fragmenting
◮ The communication delay to send the messages (∆t) ◮ The execution time (δa) and cost (∆a) of re-assembling
18 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Assume the sender migration thread is associated with
◮ The worst-case migration cost is:
WC + ∆a
WC
19 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Migration with message passing usually spans numerous
WC is very large) ◮ This makes it difficult to satisfy a migration request with
◮ Quest-V monitors support migration through direct
20 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
21 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ With direct memory copy, the worst-case migration cost
Cr ⌋ · Tr + δm mod Cr + Tr − Cr ◮ Cr and Tr are the budget and period of the migration
◮ δm is the execution time to copy an address space and its
22 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V sandboxes use Local APIC Timers and Time
◮ These time sources are not guaranteed to be synchronized ◮ Quest-V adjusts time for each migrating address space to
◮ TSCd and TSCs are the destination and source TSCs ◮ RDTSCcost and IPIcost are the average costs of reading a
23 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ To verify the predictability of the Quest-V migration
24 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Canny is migrated using message passing ◮ Migration requested with MIG RELAX flag
40 80 120 160 200 240 280 5 10 15 20 fps or x1000 KB/s Time (Seconds) Canny Comms 1 Comms 2
25 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Canny is migrated using direct memory copy ◮ Migration requested with MIG STRICT flag
50 100 150 200 250 5 10 15 20 2 4 6 fps or x1000 KB/s Migration Overhead (x1m Cycles) Time (Seconds) Canny Comms 1 Comms 2 Migration
26 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ For comparison, the same experiment was repeated
40 80 120 160 200 240 280 5 10 15 20 fps or x1000 KB/s Time (Seconds) Canny Comms 1 Comms 2
27 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
◮ Quest-V supports predictable inter-sandbox
◮ Quest-V operates like a chip-level distributed system
◮ Static partitioning of machine resources ◮ Migration for load balancing and resource affinity ◮ Comms channels built on protected shared memory
◮ Message passing versus direct memory copy ◮ Future? Lazy migration of hot pages of address spaces ◮ Extend comms across different network transport media
28 / 29
Introduction Quest-V Overview Inter-Sandbox Communication Predictable Migration Conclusions
29 / 29