Virtual-CPU Scheduling in the Quest Operating System Matthew Danish, Ye Li and Richard West Boston University April 13, 2011 Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 1 / 19
Focus of this Work Predictability and temporal isolation Guaranteed resource allocation over specific windows of time Integrated management of tasks and I/O Programs sleeping and waking Periodic tasks Interrupts from I/O devices Supporting temporal isolation using Virtual CPUs Consolidate threads on Virtual CPUs Divide up physical resources Statically scheduled Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 2 / 19
Background Building a new OS to focus on safety, predictability, and efficiency. Memory safety, program correctness Temporal isolation Optimized use of hardware resources Why not Linux? Start from a clean slate Design freedom Linux was never meant to be real-time Linux is a constantly moving target Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 3 / 19
Quest Small x86 SMP research operating system Under 11,000 lines of core kernel code Support for ACPI, PCI bus, USB, ATA drives, TCP/IP (lwIP) Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 4 / 19
VCPU Scheduling Subsystem Scheduling Class Scheduling Thread Main VCPU . . . Core 1 Core m I/O VCPU Shared Cache Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 5 / 19
Main VCPUs VCPU 0 (C=1, T=3) VCPU 1 (C=1, T=4) VCPU 2 (C=2, T=10) Timeline Budgets Fixed Priority, Rate-Monotonic Sporadic Servers Budgets replenish on a timer Replenishments can be split, or merged Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 6 / 19
I/O VCPUs I/O VCPU (Utilization=20%) 1/20% 1/20% 2/20% For tasks that react to hardware Inherits priority from Main VCPU Bandwidth-preserving Server I/O VCPU arrangement is part of policy Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 7 / 19
Evaluation Using single core of an Intel Core2 Extreme QX6700 2.6GHz 4GB DDR SDRAM available Intel 8254 x -series “e1000” network adapter UHCI-based USB connected to Mass Storage device Parallel ATA CD-ROM drive Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 8 / 19
Sporadic vs Bandwidth-Preserving Servers Experiment: Packet handling scheduling overhead Ping-flood at t = 50 Scenario 1 Scenario 2 Net Net Bandwidth Sporadic Preserving Server Server Bandwidth Sporadic Preserving Server Server I/O VCPU Network Network Card Card Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 9 / 19
Sporadic vs Bandwidth-Preserving Servers Experiment: Packet handling scheduling overhead Ping-flood at t = 50 Sporadic server overhead much higher 0.7 PIBS SS 0.6 0.5 CPU% 0.4 0.3 0.2 0.1 40 60 80 100 120 140 160 180 Time (seconds) Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 9 / 19
I/O VCPUs Inherit Priority Experiment: Reading from CD-ROM on behalf of VCPU 1 Name Capacity Period VCPU2 1 4 VCPU0 2 5 VCPU1 2 8 VCPU3 1 10 IOVCPU 10% Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 10 / 19
I/O VCPUs Inherit Priority Experiment: Reading from CD-ROM on behalf of VCPU 1 Only lower-priority VCPU 3 loses CPU time Name Capacity Period 100 VCPU2 1 4 VCPU0 2 5 90 VCPU1 2 8 80 VCPU3 1 10 IOVCPU 10% 70 60 IOVCPU CPU% VCPU3 50 VCPU2 VCPU1 40 VCPU0 30 20 10 0 Without CD-ROM I/O With CD-ROM I/O Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 10 / 19
Shared vs Separate I/O VCPUs Two I/O tasks: USB storage reading, network packet handling Experiment: single shared I/O VCPU vs two separate I/O VCPUs Scenario 1 Scenario 2 USB Net USB Net I/O VCPU USB Network USB Network Disk Card Disk Card Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19
Shared vs Separate I/O VCPUs Two I/O tasks: USB storage reading, network packet handling Experiment: single shared I/O VCPU vs two separate I/O VCPUs Compare USB bandwidth during a network ping-flood Scenario 1 Scenario 2 USB Net USB Net I/O VCPU USB Network USB Network Disk Card Disk Card Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19
Shared vs Separate I/O VCPUs Two I/O tasks: USB storage reading, network packet handling Experiment: single shared I/O VCPU vs two separate I/O VCPUs Compare USB bandwidth during a network ping-flood 200 USB Network USB (pingflood) 180 160 kB/s 140 120 100 80 Shared Separate Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19
Scheduler Overhead Experiment: scaling as the number of Main VCPUs increases Run 1 Run 2 Run 3 Run 4 Run 5 Run 6 Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 12 / 19
Scheduler Overhead Experiment: scaling as the number of Main VCPUs increases Scheduler overhead increases linearly 2 100μ s 1 ms 1.5 CPU% 1 0.5 0 4 8 12 16 20 24 # VCPUs Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 12 / 19
Conclusions Virtual CPUs for predictability and temporal isolation Main VCPUs partition physical CPU resources I/O VCPUs regulate servicing of hardware events Two-tiered scheduling hierarchy simplifies design Basis for performance isolation Real-time and embedded systems Virtual machine scheduling Partitioning of distributed cloud computing resources Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 13 / 19
Future Directions Real-time VCPU scheduling on multiple processors and cores Minimize cache contention and communication costs Maximize instructions per cycle Better safety with hardware sandboxing or software techniques Virtualization Programming language support Componentization with predictable communication Static verification of useful properties Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 14 / 19
Development Acknowledgements Richard West and Gary Wong (original developers) Matthew Danish and Ye Li (SMP and VCPU implementation) Source: http://QuestOS.github.com/ http://www.cs.bu.edu/fac/richwest/quest.html Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 15 / 19
Thank You Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 16 / 19
Extra Slides Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 17 / 19
Premature Replenishment VCPU 0 (Capacity=10, Period=40, Start=1) VCPU 1 (Capacity=20, Period=50, Start=0) +18 +18 0 2 4 6 8 10 2 4 6 8 20 2 4 6 8 30 2 4 6 8 40 2 4 6 8 50 2 4 6 8 60 2 4 6 8 70 2 4 6 8 80 2 4 6 8 90 2 4 6 8 100 2 4 6 8 110 VCPU 1 effective capacity=27 over period=50 Over-capacity exploit without proper splitting of replenishments Defects of the POSIX Sporadic Server and How to Correct Them Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 18 / 19
Fin Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 19 / 19
Recommend
More recommend