Virtual-CPU Scheduling in the Quest Operating System Matthew Danish, - - PowerPoint PPT Presentation

virtual cpu scheduling in the quest operating system
SMART_READER_LITE
LIVE PREVIEW

Virtual-CPU Scheduling in the Quest Operating System Matthew Danish, - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

VCPU Scheduling Subsystem

Shared Cache

. . .

Scheduling Scheduling Class Main VCPU I/O VCPU Thread Core 1 Core m

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 5 / 19

slide-6
SLIDE 6

Main VCPUs

Timeline Budgets

VCPU 0 (C=1, T=3) VCPU 1 (C=1, T=4) VCPU 2 (C=2, T=10)

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

slide-7
SLIDE 7

I/O VCPUs

I/O VCPU (Utilization=20%) 1/20% 2/20% 1/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

slide-8
SLIDE 8

Evaluation

Using single core of an Intel Core2 Extreme QX6700 2.6GHz 4GB DDR SDRAM available Intel 8254x-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

slide-9
SLIDE 9

Sporadic vs Bandwidth-Preserving Servers

Experiment: Packet handling scheduling overhead Ping-flood at t = 50

Scenario 2 Net Scenario 1 Net

Sporadic Server

Sporadic Server

Bandwidth Preserving Server

Bandwidth Preserving Server

I/O VCPU

Network Card Network Card

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 9 / 19

slide-10
SLIDE 10

Sporadic vs Bandwidth-Preserving Servers

Experiment: Packet handling scheduling overhead Ping-flood at t = 50 Sporadic server overhead much higher

0.1 0.2 0.3 0.4 0.5 0.6 0.7 40 60 80 100 120 140 160 180 CPU% Time (seconds) PIBS SS

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 9 / 19

slide-11
SLIDE 11

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

slide-12
SLIDE 12

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 VCPU2 1 4 VCPU0 2 5 VCPU1 2 8 VCPU3 1 10 IOVCPU 10%

Without CD-ROM I/O With CD-ROM I/O 10 20 30 40 50 60 70 80 90 100

CPU%

IOVCPU VCPU3 VCPU2 VCPU1 VCPU0

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 10 / 19

slide-13
SLIDE 13

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

USB Net Scenario 1 Scenario 2 USB Net

I/O VCPU

Network Card Network Card USB Disk USB Disk

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19

slide-14
SLIDE 14

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

USB Net Scenario 1 Scenario 2 USB Net

I/O VCPU

Network Card Network Card USB Disk USB Disk

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19

slide-15
SLIDE 15

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

Shared Separate 80 100 120 140 160 180 200

kB/s

USB Network USB (pingflood) Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 11 / 19

slide-16
SLIDE 16

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

slide-17
SLIDE 17

Scheduler Overhead

Experiment: scaling as the number of Main VCPUs increases Scheduler overhead increases linearly

4 8 12 16 20 24

# VCPUs

0.5 1 1.5 2

CPU%

100μs 1 ms

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 12 / 19

slide-18
SLIDE 18

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

slide-19
SLIDE 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

slide-20
SLIDE 20

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

slide-21
SLIDE 21

Thank You

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 16 / 19

slide-22
SLIDE 22

Extra Slides

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 17 / 19

slide-23
SLIDE 23

Premature Replenishment

2 4 6 8 10 20 30 40 50 60 70 80 90 100 110 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 +18 +18

VCPU 0 (Capacity=10, Period=40, Start=1) VCPU 1 (Capacity=20, Period=50, Start=0) 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

slide-24
SLIDE 24

Fin

Danish, Li and West (BU) VCPU Scheduling in the Quest OS April 13, 2011 19 / 19