
On 8/1/22 19:11, Sasha Algisi wrote:
Hello everyone,
This patchset aims at adding support for the SCHED_DEADLINE Linux scheduling policy for vcpus, io-threads and emulator processes.
In fact, libvirt currently supports SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHE_FIFO and SCHED_RR, but not SCHED_DEADLINE. SCHED_DEADLINE is a policy implementing an algorithm originating from the real-time scheduling community, but it can be useful outside of the real-time computing field as well.
It allows one to set a specific amount of CPU time that a task should receive with a given periodicity, and withing a certain deadline. E.g., task t should be scheduled at least for 50 ms every 100 ms. To achieve this, it needs 3 parameters: runtime, deadline and period (although period can just be equal to deadline, which is what happens automatically if one sets period=0). It must always hold that: runtime <= deadline <= period (and this is enforced by the kernel, but checks are included in the patches, so that meaningful and easy to interpret error messages can be printed to the user).
More info on SCHED_DEADLINE are available here:
https://docs.kernel.org/scheduler/sched-deadline.html
The interface will look like this, e.g., for setting SCHED_DEADLINE as a policy for 3 (0-2) vcpus, with runtime = 10000000, deadline = 15000000 and period = 20000000:
<cputune> ... <vcpusched vcpus="0-2" scheduler="deadline" runtime="10000000" deadline="15000000" period="20000000"/> ... </cputune>
This a link to a branch containing the patches:
https://gitlab.com/Algisi-00/libvirt/-/tree/sched-deadline
And this is the link to results of running the CI on such branch:
https://gitlab.com/Algisi-00/libvirt/-/pipelines/601795712
Note that the jobs that are failing are also failing in the exact same way without these patches applied.
Feedback is welcome and very much appreciated.
Thanks and regards.
Sasha Algisi (3): virprocess: define sched_attr and sched_setattr virprocess: add the SCHED_DEADLINE scheduling policy domain_conf: add SCHED_DEADLINE support in the XML configuration
NEWS.rst | 5 ++ docs/formatdomain.rst | 16 +++- src/ch/ch_process.c | 3 +- src/conf/domain_conf.c | 52 +++++++++++-- src/conf/domain_conf.h | 3 + src/conf/schemas/domaincommon.rng | 16 ++++ src/qemu/qemu_process.c | 8 +- src/util/virprocess.c | 123 +++++++++++++++++++++++++++++- src/util/virprocess.h | 6 +- 9 files changed, 216 insertions(+), 16 deletions(-)
Hey, the code looks good. However, we require that the code compiles after each patch, which is not the case with your series. The reason for our requirement is simple: easy git bisect. Therefore, it's okay if feature does not work until the very last commit. We often have patches/commits that work gradually towards grand finale. Can you please fix that in v2? Michal