This package contains the scripts and programs used to perform experimental validations for the paper "Hierarchical Scheduling of Real-Time Tasks over Linux-based Virtual Machines".
The source code can be downloaded from http://retis.santannapisa.it/~luca/RTVM/rtvm.tgz and uncompressed with tar xvf rtvm.tgz
.
The "Scripts" directory contains some shell scripts that can be used to start kvm-based VMs, and to schedule their vCPU threads with the SCHED_FIFO or SCHED_DEADLINE policy:
start_vm.sh
is the main script that can be used to start a kvm-based VM using qemu. Parameters can be passed to the script as environment variables:
KERNEL
: the full path of the kernel image to be used in the guest (the default is ~/OS/bzImage)INITRD
: the full path of an initramfs image to be used for the guest filesystem (the default is ~/OS/fs.gz)CPUS
: the number of virtual CPUs for the VM (the default is 2)QPATH
: the full path of the directory where the qemu-system-x86_64 can be found (the default is to search it in $PATH). This allow to use versions of qemu provided by the user instead of the version provided by the host OSMEM
: the amount of memory for the VM (the default is 1GB)VIRFS
: the full path for a host directory to be shared with the guest via virtfs (no directory is shared if the variable is not defined). This is useful to return experimental results from guest to hostEXTRA_ARGS
: boot time parameters to be passed to the guest kernelEXTRA_OPTS
: additional command line options for qemuset_rt_vm.sh
: schedule with SCHED_FIFO the vCPU threads of a running qemu instance. The pid of the qemu instance is passed as a first argument of the scriptset_dl_vm.sh
: schedule with SCHED_DEADLINE the vCPU threads of a running qemu instance. The pid of the qemu instance is passed as a first argument of the script, and the (Q,P) parameters for the vCPU threadsstart_rt_qemu.sh
: starts a VM with start_vm.sh, and then invokes set_rt_vm.sh on itstart_dl_qemu.sh
: starts a VM with start_vm.sh, and then invokess set_dl_vm.sh on itThe "chdl" directory contains the "chdl" C program, used to schedule with SCHED_DEADLINE an existing process. It received the pid of the process as a first argument, the SCHED_DEADLINE runtime (in microseconds) as a second argument, and the SCHED_DEADLINE period (in microseconds) as a third argument. This program is used by the "set_dl_vm.sh" script.
The "MPR-Analysis" directory contains a C program used to design an MPR interface for a given taskset. This "mpr_sched" program receives
The "Part" diretory contains the partitioning tool. To compile it, go to the "Part/src" directory and type "make". The toolis based on the CPLEX libraries; if CPLEX is not installed in the standard location, use make CPLEX=<path to CPLEX>
The "Workload directory" contains the code and scripts used to run a workload composed by periodic real-time tasks in a component inside a kvm-based VM. The scripts to be invoked by the user are in "Workload/HostScripts":
taskgen.py
: Emberson's implementation of the Randfixedsum algorithm presented at WATERS 2010generate.sh
: shell script driving taskgen.py to generate a number of tasksets with a given utilization and number of tasks. The first argument received by the script is the number of tasks and the second argument is the target utilization. The number of generated taskset can be specified through the S environment variable (default is 10). The generated tasksets are saved in TaskSets/ts-<i>.txt
, while TaskSets/ts-p-<i>.txt
contain the same tasksets with the tasks ordered by period (according to RM). For each taskset, the script also computes the (Q,P) parameters to be used to schedule the vCPU thread of a single-CPU VM running the tasket (with fixed priorities assigned according to RM) and saves them in TaskSets/sched-<i>.txt
(the Part/src/main program is used to do this)run_calibration.sh
: executes a "calibration experiment" in a kvm-based VM to measure how much a program running in the guest has to count for executing 1ms. This number is needed in order to execute reproducible experiments in a VM. To execute a reliable measure, the vCPU threads are scheduled with SCHED_FIFO and a high priority (the VM is started with the start_rt_qemu.sh script). The script accepts one single argument indicating the full path of the guest kernel. To check the reproducibility / stability of the results, 5 runs of the experiment are executed (saving the results in "Calibration/Run{1,2,3,4,5}") and the calibration is repeated 5 times per runrun_experiment.sh
: executes the periodic tasksets contained in TaskSets/ts-p-<i>.txt
directory inside a single-CPU kvm-based VM, scheduling the vCPU threads with SCHED_DEADLINE and the parameters specified in TaskSets/sched<i>.txt
. The argument of the script indicates the full path to the guest kernel, while the S
environment variable indicates the number of tasksets (default is 10). The results (response time and normalized lateness for each job of each task of the taskset) are saved in Experiment/Run<i>
(5 different runs are repeated; in every run all the S tasksets are tested)run_with_hog.sh
: same as run_experiment.sh, but a CPU hog is executed in background (as SCHED_OTHER) in the guestdo_part.sh
: similar to generate.sh, but partition each taskset on 4 virtual CPUs, using the Part/src/main program. Also designs MPR interfaces with the MPR-Analysis/mpr_sched program. The tasksets and scheduling parameters are saved in the part-<n>-<u>
directory, where <n>
is the number of tasks and <u>
is the taskset utilization.run_experiment-part.sh
: similar to run_experiment.sh, but executes the experiments in a 4 virtual CPUs VMAll the "run_*.sh" scripts work by generating an initramfs for the VM, containing the guest code to be executed to run the experiments (and an init script that automatically runs the experiments, after mounting the output directory via virtfs). The initramfs is populated by using busybox and the periodic_thread
program from PeriodicTask