Difference between revisions of "Xen Project Schedulers"

From Xen
(Tidy up and restructure the 'historical xen scheduler' section)
(RTDS is still marked experimental in xen/common/sched_rt.c (HEAD))
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
 
= Overview =
 
= Overview =
The Xen Project Hypervisor supports several different schedulers with different properties.
+
The Xen Project Hypervisor supports several different virtual CPU schedulers, with different properties.
   
  +
The job of an hypervisor's scheduler is to decide, among all the various vCPUs of the various virtual machines, which ones should run on the host's physical CPUs (pCPUs), at any given time.
Different schedulers can be assigned to
 
* an entire host
 
* a [[Cpupools_Howto|pool]] of physical CPU’s on a host (VMs need to be assigned to a pool or pinned to a CPU)
 
   
  +
It also supports having more schedulers ''active'' at the same time, on disjoint groups of pCPUs (see [[Cpupools_Howto|cpupool]])
Scheduler parameters can be modified per
 
* an entire host
 
* a CPU pool
 
* A Virtual Machine
 
<br>
 
<gallery>
 
File:Sched1.jpg
 
File:Sched2.jpg
 
File:Sched3.jpg
 
</gallery>
 
   
  +
[[File:Sched2.jpg|none|400px]]
== Schedulers in Xen 4.5 and beyond ==
 
  +
''Legend:''
 
  +
In this case, each pool has its own scheduler. In fact, even if two pools use the ''same'' scheduler, this means they're using two completely different and isolated '''instances''' of the same scheduling algorithm.
* {{Tick}} likely in 4.6
 
  +
* {{HalfDone}} possible in 4.6
 
  +
The user interacts with and affects the behaviour of the scheduler by:
<br>
 
  +
* checking or changing a scheduler's global parameters,
  +
* checking or changing a VM's scheduling parameters.
  +
  +
[[File:Sched3.jpg|none|400px]]
  +
  +
= Currently Available Schedulers =
  +
  +
== The Credit Scheduler ==
  +
  +
[[Credit Scheduler|Credit]] is a general purpose, weighted fair share scheduler, and is the current default.
  +
  +
== The Credit2 Scheduler ==
  +
  +
[[Credit2 Scheduler Development|Credit2]] is the evolution of Credit, more scalable and better with latency sensitive workload, while still being based on a general purpose, weighted fair share, scheduling algorithm.
  +
  +
== The RTDS Scheduler ==
  +
  +
[[RTDS-Based-Scheduler|RTDS]] is a real-time scheduler, meant at supporting real-time workloads in the cloud, as well as embedded and mobile virtualization use cases.
  +
  +
== The ARINC653 Scheduler ==
  +
  +
[[ARINC653 Scheduler|ARINC653]] is an embedded (automotive and avionics) real-time scheduler.
  +
  +
= Use cases and Support Status =
   
 
{|class="prettytable" style="text-align: left;" valign="top"
 
{|class="prettytable" style="text-align: left;" valign="top"
 
!style="width: 15%;"|Scheduler
 
!style="width: 15%;"|Scheduler
 
!style="width: 30%;"|Use-cases
 
!style="width: 30%;"|Use-cases
!style="width: 15%;"|Xen 4.5
+
!style="width: 15%;"|Xen < 4.7
!style="width: 30%;"|Plans for 4.6+
+
!style="width: 15%;"|Xen 4.8
  +
!style="width: 15%;"|Xen 4.9
  +
!style="width: 15%;"|Xen 4.12
 
|-
 
|-
 
|[[Credit_Scheduler|Credit]]
 
|[[Credit_Scheduler|Credit]]
 
|General Purpose
 
|General Purpose
  +
|{{Tick}} Supported<br>{{Tick}} '''Default'''
  +
|Supported<br>'''Default'''
 
|Supported<br>'''Default'''
 
|Supported<br>'''Default'''
 
|Supported
 
|Supported
 
|-
 
|-
|[[Credit2_Scheduler_Development|Credit 2]]
+
|[[Credit2_Scheduler_Development|Credit2]]
 
|General Purpose<br>
 
|General Purpose<br>
Optimized for lower latency, high VM density
+
Optimized for low latency, scalability, high VM density
|Experimental
+
|{{Tick}} Experimental
|{{Tick}} Supported<br>{{HalfDone}} '''Default'''
+
|{{Tick}} Supported
  +
|Supported
  +
|Supported<br>'''Default'''
 
|-
 
|-
 
|[[RTDS-Based-Scheduler|RTDS]]
 
|[[RTDS-Based-Scheduler|RTDS]]
|Soft & Firm Real-time<br>Multicore<br>Embedded, Automotive, Graphics & Gaming in the Cloud, Low Latency Workloads
+
|Soft & Firm Real-time<br>Embedded, mobile & automotive<br>Graphics & Gaming in the Cloud
  +
|{{Tick}} Experimental
  +
|{{Tick}} Improved xl support<br>Experimental
  +
|Experimental
 
|Experimental
 
|Experimental
|{{Tick}} Hardening<br>{{Tick}} Optimization<br>{{Tick}} Better XL support<br>{{Tick}} <1μs granularity<br>{{HalfDone}} Supported
 
 
|-
 
|-
 
|[[ARINC653_Scheduler|ARINC 653]]
 
|[[ARINC653_Scheduler|ARINC 653]]
|Hard Real-time <br>Single core<br>Avionics, Drones, Medical
+
|Hard Real-time <br>Avionics, Drones, Medical
|[http://lists.xenproject.org/archives/html/xen-devel/2015-06/msg00972.html Supported?]<br>Compile time
+
|[https://lists.xenproject.org/archives/html/xen-devel/2015-06/msg00972.html Supported?]
  +
|?
|{{Tick}} No change
 
  +
|?
  +
|?
 
|}
 
|}
   
Line 65: Line 88:
 
== Borrowed Virtual Time (BVT)==
 
== Borrowed Virtual Time (BVT)==
   
A ''virtual time'' based fair-share, general purpose, scheduler in use in Xen 2.0 and 3.0. Domains's shares of CPU time were determined by their weights. What it is traditionally called ''quantum'', or ''timeslice'', was known there as **context switch allowance**, and was configurable. It was SMP enabled, but lacked a non-work conserving mode.
+
A ''virtual time'' based fair-share, general purpose, scheduler in use in Xen 2.0 and 3.0. Domains's shares of CPU time were determined by their weights. What it is traditionally called ''quantum'', or ''timeslice'', was known there as '''context switch allowance''', and was configurable. It was SMP enabled, but lacked a non-work conserving mode.
   
 
== Atropos ==
 
== Atropos ==
Line 81: Line 104:
 
* '''sched=''' boot parameter in [http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html Xen unstable boot options]
 
* '''sched=''' boot parameter in [http://xenbits.xen.org/docs/unstable/misc/xen-command-line.html Xen unstable boot options]
 
* [[XL|xl]] [http://xenbits.xen.org/docs/unstable/man/xl.1.html#SCHEDULER-SUBCOMMANDS scheduler subcommands]
 
* [[XL|xl]] [http://xenbits.xen.org/docs/unstable/man/xl.1.html#SCHEDULER-SUBCOMMANDS scheduler subcommands]
* [[Credit Scheduler]]
 
* [[Credit2 Scheduler Development]]
 
* [[RTDS-Based-Scheduler]]
 
* [[ARINC653 Scheduler]]
 
 
* [[:Category:Scheduler]]
 
* [[:Category:Scheduler]]
 
* [[:Category:Resource Management]]
 
* [[:Category:Resource Management]]

Latest revision as of 04:30, 7 December 2019

Overview

The Xen Project Hypervisor supports several different virtual CPU schedulers, with different properties.

The job of an hypervisor's scheduler is to decide, among all the various vCPUs of the various virtual machines, which ones should run on the host's physical CPUs (pCPUs), at any given time.

It also supports having more schedulers active at the same time, on disjoint groups of pCPUs (see cpupool)

Sched2.jpg

In this case, each pool has its own scheduler. In fact, even if two pools use the same scheduler, this means they're using two completely different and isolated instances of the same scheduling algorithm.

The user interacts with and affects the behaviour of the scheduler by:

  • checking or changing a scheduler's global parameters,
  • checking or changing a VM's scheduling parameters.
Sched3.jpg

Currently Available Schedulers

The Credit Scheduler

Credit is a general purpose, weighted fair share scheduler, and is the current default.

The Credit2 Scheduler

Credit2 is the evolution of Credit, more scalable and better with latency sensitive workload, while still being based on a general purpose, weighted fair share, scheduling algorithm.

The RTDS Scheduler

RTDS is a real-time scheduler, meant at supporting real-time workloads in the cloud, as well as embedded and mobile virtualization use cases.

The ARINC653 Scheduler

ARINC653 is an embedded (automotive and avionics) real-time scheduler.

Use cases and Support Status

Scheduler Use-cases Xen < 4.7 Xen 4.8 Xen 4.9 Xen 4.12
Credit General Purpose Supported
Default
Supported
Default
Supported
Default
Supported
Credit2 General Purpose

Optimized for low latency, scalability, high VM density

Experimental Supported Supported Supported
Default
RTDS Soft & Firm Real-time
Embedded, mobile & automotive
Graphics & Gaming in the Cloud
Experimental Improved xl support
Experimental
Experimental Experimental
ARINC 653 Hard Real-time
Avionics, Drones, Medical
Supported? ? ? ?

Historical Xen Schedulers

simple Earliest Deadline First (sEDF)

Quoting from sEDF (not any longer) in-tree documentation, "this scheduler provides weighted CPU sharing in an intuitive way and uses real-time algorithms to ensure time guarantees."

The real-time algorithm used was Earliest Deadline First (EDF), although it was modified for being used as a general purpose scheduler too. It could work in both work conserving and non-work conserving modes.

It was introduced in Xen 3.0, and was the default for a while. The scheduler was never properly adapted for dealing with SMP systems and multi vCPUs VMs. Both were working, but behavior and performance were unideal and unreliable. It was eventually removed from Xen 4.6.

Borrowed Virtual Time (BVT)

A virtual time based fair-share, general purpose, scheduler in use in Xen 2.0 and 3.0. Domains's shares of CPU time were determined by their weights. What it is traditionally called quantum, or timeslice, was known there as context switch allowance, and was configurable. It was SMP enabled, but lacked a non-work conserving mode.

Atropos

A soft real-time scheduler, capable of providing guarantees on the absolute shares of CPU time, and allowing using the slack on a best-effort basis. Of course (as it's always the case in RT schedulers) CPU slices were only really guaranteed in absence of CPU over-commitment.

It was in use in Xen 2.0.

Round Robin

It was... well... Round Robin! IT was there as a simple demonstration of Xen's internal scheduler API, not for real production use.

Also See