Scheduling in Xen: Past, Present and Future Dario Faggioli - - PowerPoint PPT Presentation

scheduling in xen past present and future
SMART_READER_LITE
LIVE PREVIEW

Scheduling in Xen: Past, Present and Future Dario Faggioli - - PowerPoint PPT Presentation

Scheduling in Xen: Past, Present and Future Dario Faggioli dario.faggioli@citrix.com Seattle, WA 18th of August, 2015 Introduction Sched. in Virt. History of (Xen) Scheduling Scheduler Features Workin On Conclusions Introduction


slide-1
SLIDE 1

Scheduling in Xen: Past, Present and Future

Dario Faggioli

dario.faggioli@citrix.com

Seattle, WA – 18th of August, 2015

slide-2
SLIDE 2

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Introduction

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 2 / 39

slide-3
SLIDE 3

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Welcome

◮ Hello, my name is Dario ◮ Working on Xen (from within Citrix) since 2011 ◮ Mostly hypervisor stuff, but also toolstack: NUMA, cpupools,

scheduling

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 3 / 39

slide-4
SLIDE 4

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling & Scheduling in Xen

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 4 / 39

slide-5
SLIDE 5

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in General

Is scheduling really important, e.g., in OSes?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 5 / 39

slide-6
SLIDE 6

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in General

Is scheduling really important, e.g., in OSes? Well...

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 5 / 39

slide-7
SLIDE 7

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in General

Is scheduling really important, e.g., in OSes? Well...

◮ most of the time, there isn’t even any CPU overbooking ◮ when there’s overbooking, not everything is equally important ◮ I/O is more important!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 5 / 39

slide-8
SLIDE 8

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in Virtualization

Is scheduling really important on a virtualized host?

◮ There is pretty much always CPU overbooking ◮ All activities (i.e., all VMs) are (potentially) equally

important

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 6 / 39

slide-9
SLIDE 9

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in Virtualization

Is scheduling really important on a virtualized host?

◮ There is pretty much always CPU overbooking ◮ All activities (i.e., all VMs) are (potentially) equally

important Scheduler hacker: ≪Hey, this sounds pretty cool...≫

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 6 / 39

slide-10
SLIDE 10

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Scheduling in Virtualization

Is scheduling really important on a virtualized host?

◮ There is pretty much always CPU overbooking ◮ All activities (i.e., all VMs) are (potentially) equally

important Scheduler hacker: ≪Hey, this sounds pretty cool...≫ Well, it’s not! I/O is still more important!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 6 / 39

slide-11
SLIDE 11

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Wait a Second...

And we, on Xen, are even more special:

Xen Hypervisor Hardware

device model (qemu) toolstack Control Domain NetBSD or Linux

Hardware Drivers I/O Devices CPU Memory Paravirtualized (PV) Domain: NetBSD or Linux netback blkback netfront blkfront Driver Domain netback blkback

Xen Hypervisor Hardware

device model (qemu) toolstack Control Domain NetBSD or Linux

Hardware Drivers I/O Devices CPU Memory Paravirtualized (PV) Domain: NetBSD or Linux Fully Virtualized (HVM) Domain: Windows, FreeBSD... netback blkback netfront blkfront

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 7 / 39

slide-12
SLIDE 12

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Wait a Second...

And we, on Xen, are even more special:

◮ How does Xen hadles I/O:

Xen Hypervisor Hardware

device model (qemu) toolstack Control Domain NetBSD or Linux

Hardware Drivers I/O Devices CPU Memory Paravirtualized (PV) Domain: NetBSD or Linux netback blkback netfront blkfront Driver Domain netback blkback

Xen Hypervisor Hardware

device model (qemu) toolstack Control Domain NetBSD or Linux

Hardware Drivers I/O Devices CPU Memory Paravirtualized (PV) Domain: NetBSD or Linux Fully Virtualized (HVM) Domain: Windows, FreeBSD... netback blkback netfront blkfront

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 7 / 39

slide-13
SLIDE 13

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Wait a Second... (cont. II)

So, I/O, turns out you actually need scheduling, eh?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 8 / 39

slide-14
SLIDE 14

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

History of Xen Scheduling

(Past)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 9 / 39

slide-15
SLIDE 15

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-16
SLIDE 16

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

WHO CARES ?!?!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-17
SLIDE 17

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

WHO CARES ?!?!

No, seriously:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-18
SLIDE 18

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

WHO CARES ?!?!

No, seriously:

◮ some info at http://wiki.xen.org/wiki/Xen Project Schedulers

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-19
SLIDE 19

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

WHO CARES ?!?!

No, seriously:

◮ some info at http://wiki.xen.org/wiki/Xen Project Schedulers ◮ we just killed SEDF in 4.6 (yay!!)

check RTDS for something similar (but better!)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-20
SLIDE 20

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

I Mean... Honestly...

WHO CARES ?!?!

No, seriously:

◮ some info at http://wiki.xen.org/wiki/Xen Project Schedulers ◮ we just killed SEDF in 4.6 (yay!!)

check RTDS for something similar (but better!)

◮ that’s it

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 10 / 39

slide-21
SLIDE 21

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Xen’s Scheduler Features

(Preset)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 11 / 39

slide-22
SLIDE 22

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Hard and Soft Affinity

◮ pinning: you can run there and only there!

#xl vcpu-pin vm1 0 2

◮ hard affinity: you can’t run outside of that spot

# xl vcpu-pin vm1 all 8-12

◮ soft affinity: you can’t run outside of that spot and,

preferably, you should ru there # xl vcpu-pin vm1 all - 10,11 Same achieved with cpus= and cpus soft= in config file. cpus= or cpus soft= in config file control where memory is allocated

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 12 / 39

slide-23
SLIDE 23

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Hard and Soft Affinity (cont.)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 13 / 39

slide-24
SLIDE 24

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA

Automatic placement policy in libxl (since Xen 4.2)

◮ acts at domain creation time, important for memory

allocation!

◮ easy to tweak (at libxl build time, for now) heuristics:

◮ use the smallest possible set of nodes (ideally, just one) ◮ use the (set of) node(s) with fewer vCPUs bound to it ([will]

consider both hard and soft affinity)

◮ use the (set of) node(s) with the most free RAM (mimics the

“worst fit”algorithm)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 14 / 39

slide-25
SLIDE 25

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA

Automatic placement policy in libxl (since Xen 4.2)

◮ acts at domain creation time, important for memory

allocation!

◮ easy to tweak (at libxl build time, for now) heuristics:

◮ use the smallest possible set of nodes (ideally, just one) ◮ use the (set of) node(s) with fewer vCPUs bound to it ([will]

consider both hard and soft affinity)

◮ use the (set of) node(s) with the most free RAM (mimics the

“worst fit”algorithm)

Example: 4 GB VM, 6 GB free on node0, 8 GB free on node1

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 14 / 39

slide-26
SLIDE 26

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA

Automatic placement policy in libxl (since Xen 4.2)

◮ acts at domain creation time, important for memory

allocation!

◮ easy to tweak (at libxl build time, for now) heuristics:

◮ use the smallest possible set of nodes (ideally, just one) ◮ use the (set of) node(s) with fewer vCPUs bound to it ([will]

consider both hard and soft affinity)

◮ use the (set of) node(s) with the most free RAM (mimics the

“worst fit”algorithm)

Example: 4 GB VM, 6 GB free on node0, 8 GB free on node1 Bound vCPUs: 12 to node0, 16 to node1 = ⇒ use node0

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 14 / 39

slide-27
SLIDE 27

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA

Automatic placement policy in libxl (since Xen 4.2)

◮ acts at domain creation time, important for memory

allocation!

◮ easy to tweak (at libxl build time, for now) heuristics:

◮ use the smallest possible set of nodes (ideally, just one) ◮ use the (set of) node(s) with fewer vCPUs bound to it ([will]

consider both hard and soft affinity)

◮ use the (set of) node(s) with the most free RAM (mimics the

“worst fit”algorithm)

Example: 4 GB VM, 6 GB free on node0, 8 GB free on node1 Bound vCPUs: 12 to node0, 16 to node1 = ⇒ use node0 Bound vCPUs: 8 to node0, 8 to node1 = ⇒ use node1

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 14 / 39

slide-28
SLIDE 28

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA

Automatic placement policy in libxl (since Xen 4.2)

◮ acts at domain creation time, important for memory

allocation!

◮ easy to tweak (at libxl build time, for now) heuristics:

◮ use the smallest possible set of nodes (ideally, just one) ◮ use the (set of) node(s) with fewer vCPUs bound to it ([will]

consider both hard and soft affinity)

◮ use the (set of) node(s) with the most free RAM (mimics the

“worst fit”algorithm)

Example: 4 GB VM, 6 GB free on node0, 8 GB free on node1 Bound vCPUs: 12 to node0, 16 to node1 = ⇒ use node0 Bound vCPUs: 8 to node0, 8 to node1 = ⇒ use node1 Coming: node distances, IONUMA, vNUMA

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 14 / 39

slide-29
SLIDE 29

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

What about NUMA (cont.)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 15 / 39

slide-30
SLIDE 30

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

For Dom0

◮ dom0 max vcpu: makes sense ◮ dom0 vcpus pin: bleah!! ◮ dom0 nodes: new parameter. Place Dom0’s vCPUs and

memory on one or more nodes

◮ strict (default) uses hard affinity ◮ relaxed uses soft affinity Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 16 / 39

slide-31
SLIDE 31

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

For Dom0 (cont.)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 17 / 39

slide-32
SLIDE 32

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Workin’ On

(Future)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 18 / 39

slide-33
SLIDE 33

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel PSR

Intel Platform Shared Resource Monitoring (PSR):

◮ Cache Monitoring Technology (CMT) ◮ Cache Allocation Technology (CAT)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 19 / 39

slide-34
SLIDE 34

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel PSR

Intel Platform Shared Resource Monitoring (PSR):

◮ Cache Monitoring Technology (CMT) ◮ Cache Allocation Technology (CAT)

CMT: gather information useful for mid-level load balancing decisions (e.g., at vCPU wakeup, or across sockets/NUMA nodes):

◮ how ’cache hungry’ is a given pCPU? ◮ how much free chace is there on a given socket/NUMA node?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 19 / 39

slide-35
SLIDE 35

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel PSR

Intel Platform Shared Resource Monitoring (PSR):

◮ Cache Monitoring Technology (CMT) ◮ Cache Allocation Technology (CAT)

CMT: gather information useful for mid-level load balancing decisions (e.g., at vCPU wakeup, or across sockets/NUMA nodes):

◮ how ’cache hungry’ is a given pCPU? ◮ how much free chace is there on a given socket/NUMA node?

CAT: when setting affinity, set CAT accordingly (and vice versa?):

◮ if you’re going to run on pCPUs #x, #y and #z... ◮ ...you better have some cache space reserved there!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 19 / 39

slide-36
SLIDE 36

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler

Scheduler paravirtualization?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 20 / 39

slide-37
SLIDE 37

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler

Scheduler paravirtualization? SHHSH!! There’s Linux people in the other room, what it they hear!?!?! :-O

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 20 / 39

slide-38
SLIDE 38

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler

Scheduler paravirtualization? SHHSH!! There’s Linux people in the other room, what it they hear!?!?! :-O An example: scheduling domains:

◮ scalability measure (for the Linux scheduler) ◮ balance the load: often among SMT threads, less often

between NUMA nodes!

◮ based on CPU topology

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 20 / 39

slide-39
SLIDE 39

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler (cont.)

In Xen:

◮ vCPUs wander among pCPUs ◮ vCPU #0 and #1 of a guest can be SMT siblings or not... at

different times!!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 21 / 39

slide-40
SLIDE 40

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler (cont.)

In Xen:

◮ vCPUs wander among pCPUs ◮ vCPU #0 and #1 of a guest can be SMT siblings or not... at

different times!!

◮ it doesn’t make sense, in the guest, to try to optimize

scheduling basing on something that varies

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 21 / 39

slide-41
SLIDE 41

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Interactions With Guests’ (Linux’s) Scheduler (cont.)

In Xen:

◮ vCPUs wander among pCPUs ◮ vCPU #0 and #1 of a guest can be SMT siblings or not... at

different times!!

◮ it doesn’t make sense, in the guest, to try to optimize

scheduling basing on something that varies How to avoid this?

◮ flat layout for the scheduling domains → just one domain with

all the pCPUs

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 21 / 39

slide-42
SLIDE 42

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2

Credit2 scheduler, authored by George, is still in experimental status.

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 22 / 39

slide-43
SLIDE 43

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2

Credit2 scheduler, authored by George, is still in experimental status. Take it out from there!!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 22 / 39

slide-44
SLIDE 44

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2

Credit2 scheduler, authored by George, is still in experimental status. Take it out from there!! Why? In general, more advanced, a lot of potential:

◮ historical load based load balancing ◮ runqueue kept in order of credit (instead than Round-Robin as

in Credit1)

◮ configurable runqueue arrangement

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 22 / 39

slide-45
SLIDE 45

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why?

Complexity:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 23 / 39

slide-46
SLIDE 46

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why?

Complexity:

◮ in Credit we have:

◮ credits and weights ◮ 2 priorities ◮ oh, actually, it’s 3 ◮ active and non active state of vCPUs ◮ flipping between active/non-active means flipping between

burning/non-burning credits, which in turns means wandering around among priorities

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 23 / 39

slide-47
SLIDE 47

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why?

Complexity:

◮ in Credit we have:

◮ credits and weights ◮ 2 priorities ◮ oh, actually, it’s 3 ◮ active and non active state of vCPUs ◮ flipping between active/non-active means flipping between

burning/non-burning credits, which in turns means wandering around among priorities

◮ in Credit2 we have:

◮ credits burned basing on weights Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 23 / 39

slide-48
SLIDE 48

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why?

Complexity:

◮ in Credit we have:

◮ credits and weights ◮ 2 priorities ◮ oh, actually, it’s 3 ◮ active and non active state of vCPUs ◮ flipping between active/non-active means flipping between

burning/non-burning credits, which in turns means wandering around among priorities

◮ in Credit2 we have:

◮ credits burned basing on weights ◮ that’s it Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 23 / 39

slide-49
SLIDE 49

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why?

Complexity:

◮ in Credit we have:

◮ credits and weights ◮ 2 priorities ◮ oh, actually, it’s 3 ◮ active and non active state of vCPUs ◮ flipping between active/non-active means flipping between

burning/non-burning credits, which in turns means wandering around among priorities

◮ in Credit2 we have:

◮ credits burned basing on weights ◮ that’s it ◮ no, really, it’s that simple! :-) Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 23 / 39

slide-50
SLIDE 50

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why? (cont.)

Scalability:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 24 / 39

slide-51
SLIDE 51

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why? (cont.)

Scalability:

◮ in Credit

◮ periodic runqueue sorting. Freezes a runqueue ◮ periodic accounting. Freezes the whole scheduler! Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 24 / 39

slide-52
SLIDE 52

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Why? (cont.)

Scalability:

◮ in Credit

◮ periodic runqueue sorting. Freezes a runqueue ◮ periodic accounting. Freezes the whole scheduler!

◮ in Credit2 we have:

◮ “global”lock only for load balancing

(looking at improving it)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 24 / 39

slide-53
SLIDE 53

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: What’s Missing?

◮ SMT awareness (done, missing final touches) ◮ hard and soft affinity support (someone working on it) ◮ tweaks and optimization in the load balancer (someone

looking at it)

◮ cap and reservation (!!!)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 25 / 39

slide-54
SLIDE 54

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: What’s Missing?

◮ SMT awareness (done, missing final touches) ◮ hard and soft affinity support (someone working on it) ◮ tweaks and optimization in the load balancer (someone

looking at it)

◮ cap and reservation (!!!)

Plan: mark it as !experimantal for 4.6

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 25 / 39

slide-55
SLIDE 55

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: What’s Missing?

◮ SMT awareness (done, missing final touches) ◮ hard and soft affinity support (someone working on it) ◮ tweaks and optimization in the load balancer (someone

looking at it)

◮ cap and reservation (!!!)

Plan: mark it as !experimantal for 4.6 New Plan: mark it as !experimental for 4.7 :-P

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 25 / 39

slide-56
SLIDE 56

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-57
SLIDE 57

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

◮ 16 pCPUs host ◮ 8 vCPUs guest

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-58
SLIDE 58

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

◮ 16 pCPUs host ◮ 8 vCPUs guest ◮ varying # of build jobs → # of vCPUs busy in the guest

◮ -j4, -j8, -j (unlimited) Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-59
SLIDE 59

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

◮ 16 pCPUs host ◮ 8 vCPUs guest ◮ varying # of build jobs → # of vCPUs busy in the guest

◮ -j4, -j8, -j (unlimited)

◮ varying the interferece load → # of vCPUs active in Dom0

◮ nothing, 4 CPU hog tasks, 12 CPU hog tasks Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-60
SLIDE 60

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

◮ 16 pCPUs host ◮ 8 vCPUs guest ◮ varying # of build jobs → # of vCPUs busy in the guest

◮ -j4, -j8, -j (unlimited)

◮ varying the interferece load → # of vCPUs active in Dom0

◮ nothing, 4 CPU hog tasks, 12 CPU hog tasks

Anticipation:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-61
SLIDE 61

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation

Time for building Xen:

◮ 16 pCPUs host ◮ 8 vCPUs guest ◮ varying # of build jobs → # of vCPUs busy in the guest

◮ -j4, -j8, -j (unlimited)

◮ varying the interferece load → # of vCPUs active in Dom0

◮ nothing, 4 CPU hog tasks, 12 CPU hog tasks

Anticipation:

◮ Some tweaks still missing, but really promising!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 26 / 39

slide-62
SLIDE 62

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont.)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 27 / 39

slide-63
SLIDE 63

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont.)

Credit 2 with HyperThreading support FTW (a.k.a: we’re done here, let’s go have beers!! ;-P)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 27 / 39

slide-64
SLIDE 64

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont. II)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 28 / 39

slide-65
SLIDE 65

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont. II)

Almost good, apart from ”-j4”. It should be consistend with ”-j4”

  • f ”no interf” (a.k.a.: ok, maybe just one beer?)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 28 / 39

slide-66
SLIDE 66

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont. III)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 29 / 39

slide-67
SLIDE 67

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Credit2: Performance Evaluation (cont. III)

Really good against Credit1, but ”-j4” still has issues (a.k.a.: ok, I got it. Let’s grab some coffee and get back to work!)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 29 / 39

slide-68
SLIDE 68

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Conclusions

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 30 / 39

slide-69
SLIDE 69

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Conclusions

Having our scheduler and being able to tweak it to our nees is very important:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 31 / 39

slide-70
SLIDE 70

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Conclusions

Having our scheduler and being able to tweak it to our nees is very important:

◮ we should continously try assess where we stand (performance

wise, scalability wise, etc.)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 31 / 39

slide-71
SLIDE 71

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Conclusions

Having our scheduler and being able to tweak it to our nees is very important:

◮ we should continously try assess where we stand (performance

wise, scalability wise, etc.)

◮ we should always strive to do better!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 31 / 39

slide-72
SLIDE 72

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Q&A

Thanks again, Questions?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 32 / 39

slide-73
SLIDE 73

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Spare Slides

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 33 / 39

slide-74
SLIDE 74

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CMT

Biggest limitations:

◮ num. of activitieas that can be monitored is limited ◮ applies to L3 cache only, for now

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 34 / 39

slide-75
SLIDE 75

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CMT

Biggest limitations:

◮ num. of activitieas that can be monitored is limited ◮ applies to L3 cache only, for now

What would be desirable:

◮ per-vCPU granularity =

⇒ No! Too few monitoring IDs

◮ L2 occupancy/bandwidth stats, for helping intra-socket

scheduling decisions = ⇒ No! Only L3

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 34 / 39

slide-76
SLIDE 76

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CMT

Biggest limitations:

◮ num. of activitieas that can be monitored is limited ◮ applies to L3 cache only, for now

What would be desirable:

◮ per-vCPU granularity =

⇒ No! Too few monitoring IDs

◮ L2 occupancy/bandwidth stats, for helping intra-socket

scheduling decisions = ⇒ No! Only L3 What I’m thinking to:

◮ use one monitoring ID per pCPU. This gives:

◮ how ’cache hungry’ a pCPU is being ◮ how much free chace there is on each socket/NUMA node

◮ sample periodically and use for mid-level load balancing

decisions

◮ ... ideas welcome!!

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 34 / 39

slide-77
SLIDE 77

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CAT

Basic idea:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 35 / 39

slide-78
SLIDE 78

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CAT

Basic idea:

◮ if you’re going to run on pCPUs #x, #y and #z... ◮ ...you better have some cache space reserved there!

Implementation:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 35 / 39

slide-79
SLIDE 79

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CAT

Basic idea:

◮ if you’re going to run on pCPUs #x, #y and #z... ◮ ...you better have some cache space reserved there!

Implementation:

◮ when setting affinity, set CAT accordingly

Open ”issues”:

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 35 / 39

slide-80
SLIDE 80

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

(Better) Exploiting Intel CAT

Basic idea:

◮ if you’re going to run on pCPUs #x, #y and #z... ◮ ...you better have some cache space reserved there!

Implementation:

◮ when setting affinity, set CAT accordingly

Open ”issues”:

◮ always? ◮ for hard affinity, or soft affinity, or both? ◮ with what mask (i.e., how to split the cache)? ◮ what about the vice-versa?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 35 / 39

slide-81
SLIDE 81

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Driver Domain Aware Scheduling

Suppose:

◮ vCPU x is top priority (higher credits, whatever) ◮ vCPU x issues an I/O operation. It has some remaining

timeslice (or credit, or whatever) available, but it blocks waiting for results

◮ some other domains’ vCPUs y, w and z have higher priority

than I/O’s vCPUs (Dom0 or driver domain)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 36 / 39

slide-82
SLIDE 82

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Driver Domain Aware Scheduling

Suppose:

◮ vCPU x is top priority (higher credits, whatever) ◮ vCPU x issues an I/O operation. It has some remaining

timeslice (or credit, or whatever) available, but it blocks waiting for results

◮ some other domains’ vCPUs y, w and z have higher priority

than I/O’s vCPUs (Dom0 or driver domain) Schedule: vx, vy, vw, vz, vdrv dom − → only now vx can resume

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 36 / 39

slide-83
SLIDE 83

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Driver Domain Aware Scheduling (cont.)

What if, vx could donate its timeslice to the entity that is blocking it?

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 37 / 39

slide-84
SLIDE 84

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Driver Domain Aware Scheduling (cont.)

What if, vx could donate its timeslice to the entity that is blocking it? Schedule: vx, vdrv dom, vx, vw, vz − → vx unblocks right away (this, assuming servicing I/O to be quick, and does not even exhaust vx timeslice)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 37 / 39

slide-85
SLIDE 85

Introduction

  • Sched. in Virt.

History of (Xen) Scheduling Scheduler Features Workin’ On Conclusions

Driver Domain Aware Scheduling (cont.)

What if, vx could donate its timeslice to the entity that is blocking it? Schedule: vx, vdrv dom, vx, vw, vz − → vx unblocks right away (this, assuming servicing I/O to be quick, and does not even exhaust vx timeslice)

◮ avoids priority inversion (no, we’re not the Mars Pathfinder,

but still...)

◮ makes vx sort of “pay”, from the CPU load it generates with

its I/O requests (fairness++)

Seattle, WA – 18th of August, 2015 Scheduling in Xen: Past, Present and Future 37 / 39