RTDS Scheduler

Revision 1

1 Basics

Status: Experimental
Component: Hypervisor

2 Overview

RTDS is one of the virtual CPU (vCPU) scheduler available in the Xen hypervisor.

RTDS is a real-time scheduler, so its purpose is enabling deterministic scheduling of the virtual machine’s vCPUs. It has been originally developed in the context of the RT-Xen project.

3 User details

RTDS is not in use by default. In order to use it as the Xen scheduler the following parameter should be passed to the hypervisor at boot:

`sched=rtds`

Once the system is live, for creating a cpupool with RTDS as its scheduler, either compile a cpupool configuration file, as described in docs/man/xlcpupool.cfg.pod.5 (and as exemplified in tools/examples/cpupool), or use just xl directly:

xl cpupool-create name=\"pool-rt\" sched=\"rtds\" cpus=[4,5,6,8]

For checking or changing a VM’s scheduling parameters from xl, do as follows: * xl sched-rtds -d vm-rt -v all * xl sched-rtds -d vm-rt -v all -p 10000 -b 2500

It is possible, for a multiple vCPUs VM, to change the parameters of each vCPU individually: * xl sched-rtds -d vm-rt -v 0 -p 20000 -b 10000 -e 1 -v 1 -p 45000 -b 12000 -e 0

4 Technical details

Implementation entirely lives in the hypervisor. Xen has a pluggable, hook based, architecture for schedulers. Thanks to this, RTDS code is all contained in xen/common/sched_rtds.c.

In libxl, the availability of the RTDS scheduler is advertised by the presence of the LIBXL_HAVE_SCHED_RTDS symbol. The ability of specifying different scheduling parameters for each vcpu has been introduced later, and is available if the following symbols are defined: * LIBXL_HAVE_VCPU_SCHED_PARAMS, * LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS, * LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA.

5 Limitations

RTDS is a special purpose scheduling. This is by design, and not at all a limitation, but it is certainly something to keep in mind when thinking about using it. The purpose of the scheduler is enabling deterministic and statically analyzable behavior (as per the real-time academic literature), according to the scheduling parameters assigned to each vCPU.

Using RTDS a the Xen scheduler, and/or for general purpose workloads is definitely possible, but the vCPU scheduling parameters (of both Domain0 and of the various VMs) would probably require tweaking, with respect to their default values.

6 Testing

Any change done in RTDS must be tested by doing the following:

The fact that the system boots fine when passing sched=rtds to Xen should also be verified.

Finally, to check that the scheduler is working properly (although only at a macroscopic level), the following should be done:

7 Areas for improvement

8 Known issues

9 References

10 History

Date Revision Version Notes
2016-10-14 2017-08-31 1 2 Xen 4.8 Xen 4.10 Document written Revise for work conserving feature