User:Pennpanda: Difference between revisions
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
===Also See=== |
===Also See=== |
||
*[http://xenbits.xen.org/docs/unstable/man/xl.1.html#scheduler_subcommands Scheduler Subcommands] |
*[http://xenbits.xen.org/docs/unstable/man/xl.1.html#scheduler_subcommands Scheduler Subcommands] |
||
*[https://sites.google.com/site/realtimexen/ RT-Xen website] |
|||
*[https://blog.xenproject.org/2013/11/27/rt-xen-real-time-virtualization-in-xen/ Blog of RT-Xen] |
Revision as of 16:47, 19 December 2014
Real-Time-Deferrable-Server-Based CPU Scheduler
Introduction
The rtds scheduler is a real-time CPU scheduler built to provide guaranteed CPU capacity to real-time workload on SMP hosts. It is introduced in Xen 4.5 as an experimental scheduler.
Description
Each VCPU of each domain is assigned a budget and a period. The VCPU with (budget, period) is supposed to have budget us in every period us.
Note: The VCPUs of the same domain have the same parameters right now.
Usage
The "xl sched-rtds" command can be used to tune the per VM guest scheduler parameters.
- xl sched-rtds -d <domain> :List the parameter of the specified <domain>
- xl sched-rtds -d <domain> -p <period> -b <budget> : Set each VCPU's budget to <budget> and period to <period> of the specified <domain>
Algorithm
The design of this rtds scheduler is as follows:
This scheduler follows the Preemptive Global Earliest Deadline First (EDF) theory in real-time field. At any scheduling point, the VCPU with earlier deadline has higher priority. The scheduler always picks the highest priority VCPU to run on a feasible PCPU. A PCPU is feasible if the VCPU can run on this PCPU and the PCPU is idle or has a lower-priority VCPU running on it.
Each VCPU has a dedicated period and budget. The deadline of a VCPU is at the end of each period; A VCPU has its budget replenished at the beginning of each period; While scheduled, a VCPU burns its budget. The VCPU needs to finish its budget before its deadline in each period; The VCPU discards its unused budget at the end of each period. If a VCPU runs out of budget in a period, it has to wait until next period.
Each VCPU is implemented as a deferable server. When a VCPU has a task running on it, its budget is continuously burned; When a VCPU has no task but with budget left, its budget is preserved.
Queue scheme: A global runqueue and a global depletedq for each CPU pool. The runqueue holds all runnable VCPUs with budget and sorted by deadline; The depletedq holds all VCPUs without budget and unsorted.
Glossary of Terms
- us: microsecond
- Host: The physical hardware running Xen and hosting guest VMs.
- VM: Guest virtual machine.
- VCPU: Virtual CPU (one or more per VM).
- CPU/PCPU: Physical host CPU.
- Period: The period when a VCPU's budget is replenished or discarded.
- Budget: The amount of time a VCPU can execute within its period.