|
|
Subscribe / Log in / New account

The future of SCHED_DEADLINE and SCHED_RT for capacity-constrained and asymmetric-capacity systems

July 10, 2019


OSPM

The kernel's deadline scheduling class (SCHED_DEADLINE) enables realtime scheduling where every task is guaranteed to meet its deadlines. Unfortunately SCHED_DEADLINE's current view on CPU capacity is far too simple. It doesn't take dynamic voltage and frequency scaling (DVFS), simultaneous multithreading (SMT), asymmetric CPU capacity, or any kind of performance capping (e.g. due to thermal constraints) into consideration.

In particular, if we consider running deadline tasks in a system with performance capping, the question is "what level of guarantee should SCHED_DEADLINE provide?". An interesting discussion about the pro and cons of different approaches (weak, hard, or mixed guarantees) developed during this presentation. There were many different views but the discussion didn't really conclude and will have to be continued at the Linux Plumbers Conference later this year.

The topic of guaranteed performance will become more important for mobile systems in the future as performance capping is likely to become more common. Defining hard guarantees is almost impossible on real systems since silicon behavior very much depends on environmental conditions. The main pushback on the existing scheme is that the guaranteed bandwidth budget might be too conservative. Hence SCHED_DEADLINE might not allow enough bandwidth to be reserved for use cases with higher bandwidth requirements that can tolerate bandwidth reservations not being honored.

The discussion further evolved on the concept of a "tunable granted capacity", which is always available under "reasonable working conditions", and a maximum "best-effort capacity". Such a model would allow SCHED_DEADLINE to admit tasks under two different service-level objectives and thus to know which tasks will be more likely to suffer deadline misses in the case of reduced CPU capacity. However, this approach will make the kernel-space admission-control policy more complicated. A different strategy could be to keep kernel-space admission control simple and add more advanced admission-control policies that are managed by a privileged entity in user space.

There are various improvements to make SCHED_DEADLINE more applicable in modern mobile platforms. The "Capacity awareness for SCHED_DEADLINE" RFC patch set by Luca Abeni provides an essential feature for systems with asymmetric CPU capacity. More long-term tasks involve exploring the possibilities to make the admission control aware of guaranteed performance levels from the hardware or firmware, as well as introducing energy-aware task placement into the deadline scheduler class.

Regarding the realtime scheduling class (SCHED_RT), it also has issues when it comes to using it in a mobile system. Running RT tasks at the highest CPU capacity, the way mainline Linux does, is too expensive and not always required. SCHED_RT also assumes symmetric CPU capacities and is unaware of running or runnable CFS tasks.

Like for SCHED_DEADLINE, there are some improvements to make SCHED_RT more applicable in modern mobile platforms. The utilization clamping patch set (which has been merged for 5.3) allows for more fine-grained CPU frequency decisions via per-task, per-task-group, or system-wide performance constraints. Other possible improvements, like making SCHED_RT CPU capacity aware to get more predictable performance on asymmetric-CPU-capacity systems, or making SCHED_RT aware of CFS tasks (and vice versa) were also briefly mentioned.

Index entries for this article
ConferenceOS-Directed Power-Management Summit/2019


to post comments


Copyright © 2019, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds