Difference between revisions of "Xen Project Schedulers"

From Xen
(Migrated page)
 
m (formatting)
Line 21: Line 21:
 
sched=bvt
 
sched=bvt
 
Global Parameters
 
Global Parameters
ctx_allow - The context switch allowance is similar to the ``quantum'' in traditional schedulers. It is the minimum time that a scheduled domain will be allowed to run before being preempted.
+
ctx_allow - The context switch allowance is similar to the ''quantum'' in traditional schedulers.
  +
It is the minimum time that a scheduled domain will be allowed to run before being preempted.
  +
 
Per-domain parameters
 
Per-domain parameters
 
mcuadv - the MCU (Minimum Charging Unit) advance determines the proportional share of the CPU
 
mcuadv - the MCU (Minimum Charging Unit) advance determines the proportional share of the CPU
Line 34: Line 36:
 
<pre><nowiki>
 
<pre><nowiki>
 
sched=atropos
 
sched=atropos
Atropos is a soft real time scheduler. It provides guarantees about absolute shares of the CPU, with a facility for sharing slack CPU time on a best-effort basis. It can provide timeliness guarantees for latency-sensitive domains.
+
Atropos is a soft real time scheduler. It provides guarantees about absolute shares of the CPU,
  +
with a facility for sharing slack CPU time on a best-effort basis. It can provide timeliness
Every domain has an associated period and slice. The domain should receive `slice' nanoseconds every `period' nanoseconds. This allows the administrator to configure both the absolute share of the CPU a domain receives and the frequency with which it is scheduled.
 
  +
guarantees for latency-sensitive domains.
Note: don't over-commit the CPU when using Atropos (i.e. don't reserve more CPU than is available -- the utilization should be kept to slightly less than 100% in order to ensure predictable behavior).
 
  +
  +
Every domain has an associated period and slice. The domain should receive `slice' nanoseconds
  +
every `period' nanoseconds. This allows the administrator to configure both the absolute share
  +
of the CPU a domain receives and the frequency with which it is scheduled.
  +
  +
Note: don't over-commit the CPU when using Atropos (i.e. don't reserve more CPU than is
  +
available -- the utilization should be kept to slightly less than 100% in order to ensure predictable
  +
behavior).
  +
 
Per-domain parameters :
 
Per-domain parameters :
 
period - The regular time interval during which a domain is guaranteed to receive its allocation of CPU time.
 
period - The regular time interval during which a domain is guaranteed to receive its allocation of CPU time.
Line 48: Line 59:
 
<pre><nowiki>
 
<pre><nowiki>
 
sched=rrobin
 
sched=rrobin
The round robin scheduler is included as a simple demonstration of Xen's internal scheduler API. It is not intended for production use.
+
The round robin scheduler is included as a simple demonstration of Xen's internal scheduler
  +
API. It is not intended for production use.
  +
 
Global Parameters
 
Global Parameters
 
rr_slice - The maximum time each domain runs before the next scheduling decision is made.
 
rr_slice - The maximum time each domain runs before the next scheduling decision is made.
Line 58: Line 71:
 
sched=sedf
 
sched=sedf
 
(from docs/misc/sedf_scheduler_mini-HOWTO.txt)
 
(from docs/misc/sedf_scheduler_mini-HOWTO.txt)
This scheduler provides weighted CPU sharing in an intuitive way and uses realtime-algorithms to ensure time guarantees.
+
This scheduler provides weighted CPU sharing in an intuitive way and uses realtime-algorithms
  +
to ensure time guarantees.
  +
 
Per-domain parameters
 
Per-domain parameters
 
use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
 
use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"

Revision as of 10:55, 4 May 2012


Icon todo.png To Do:

This document gives an overview of Xen scheduling, but is likely out-of-date


Xen Scheduling

This scheduling wiki page was originally compiled by Jacob Mathai(Jacob Mathai (Profile)).

Xen is a virtual machine monitor (VMM) for x86-compatible computers. Xen can securely execute multiple virtual machines, each running its own OS, on a single physical system with close-to-native performance.

(This information is also available in the Xen 2.0 documentation and in some scattered readme files) http://www.cl.cam.ac.uk/Research/SRG/netos/xen/documentation.html Xen includes kernel boot time options for scheduling. Similiar to traditional Linux schedulers that divide CPU time for userland processes, XEN schedules resources between VMs. Below you will find some Xen & DomU options for the schedulers.

1. Borrowed Virtual Time (Xen 2.0/3.0)

sched=bvt
Global Parameters
ctx_allow - The context switch allowance is similar to the ''quantum'' in traditional schedulers. 
It is the minimum time that a scheduled domain will be allowed to run before being preempted.

Per-domain parameters
mcuadv - the MCU (Minimum Charging Unit) advance determines the proportional share of the CPU
that a domain receives. It is set inversely proportionally to a domain's sharing weight.
warp - the amount of `virtual time' the domain is allowed to warp backwards
warpl - the warp limit is the maximum time a domain can run warped for
warpu - the unwarp requirement is the minimum time a domain must run unwarped for before it can warp again

2. Atropos (Xen 2.0)

sched=atropos
Atropos is a soft real time scheduler. It provides guarantees about absolute shares of the CPU, 
with a facility for sharing slack CPU time on a best-effort basis. It can provide timeliness 
guarantees for latency-sensitive domains.

Every domain has an associated period and slice. The domain should receive `slice' nanoseconds 
every `period' nanoseconds. This allows the administrator to configure both the absolute share 
of the CPU a domain receives and the frequency with which it is scheduled.

Note: don't over-commit the CPU when using Atropos (i.e. don't reserve more CPU than is 
available -- the utilization should be kept to slightly less than 100% in order to ensure predictable 
behavior).

Per-domain parameters :
period - The regular time interval during which a domain is guaranteed to receive its allocation of CPU time.
slice - The length of time per period that a domain is guaranteed to run for (in the absence of voluntary yielding of the CPU).
latency - The latency hint is used to control how soon after waking up a domain it should be scheduled.
xtratime - This is a boolean flag that specifies whether a domain should be allowed a share of the system slack time.

3. Round Robin (Xen 2.0)

sched=rrobin
The round robin scheduler is included as a simple demonstration of Xen's internal scheduler 
API. It is not intended for production use.

Global Parameters
rr_slice - The maximum time each domain runs before the next scheduling decision is made.

4. sEDF scheduler (Xen 3.0)

sched=sedf
(from docs/misc/sedf_scheduler_mini-HOWTO.txt)
This scheduler provides weighted CPU sharing in an intuitive way and uses realtime-algorithms 
to ensure time guarantees.

Per-domain parameters
use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
-period/slice are the normal EDF scheduling parameters in nanosecs
-latency-hint is the scaled period in case the domain is doing heavy I/O
(unused by the currently compiled version)
-extra is a flag (0/1), which controls whether the domain can run in extra-time
-weight is mutually exclusive with period/slice and specifies another way of setting a domains cpu slice
See wikipedia for a short intro to EDF:
http://en.wikipedia.org/wiki/Earliest_deadline_first_scheduling

System Calls and Scheduling

Some Scheduling System Calls
/schedule.c
SCHEDOP_yield
SCHEDOP_block
SCHEDOP_shutdown
 *nice( )
getpriority( )
setpriority( )
sched_getscheduler( )
sched_setscheduler( )
sched_getparam( )
sched_setparam( )
sched_yield( )
sched_get_ priority_min( )
sched_get_ priority_max( )
sched_rr_get_interval( )

A related wiki topic on Real Time Applications & Preemption .

Also See