|
|
Subscribe / Log in / New account

A new deadline scheduler patch

By Jonathan Corbet
March 10, 2010
The POSIX approach to realtime scheduling is based on priorities: the highest-priority task gets the CPU. The research community has long since moved on from priorities, though, and has been putting a lot of effort into deadline scheduling instead. Deadline schedulers allow each process to provide a "worst case execution time" and the deadline by which it must get that time; it can then schedule all tasks so that they meet their deadlines while refusing tasks which would cause that promise to be broken. There are a few deadline scheduler patches in circulation, but the SCHED_DEADLINE patch by Dario Faggioli and friends looks like the most likely one to make it into the mainline at this time; LWN looked at this patch back in October.

Recently, version 2 of the SCHED_DEADLINE patch was posted. The changes reflect a number of comments which were made the first time around; among other things, there is a new implementation of the group scheduling mechanism. Perhaps most significant in this patch, though, is an early attempt at addressing priority inversion problems, where a low-priority process can, by holding shared resources, prevent a higher-priority process from running. Priority inversion is a hard problem, and, in the deadline scheduling area, it remains without a definitive solution.

In classic realtime scheduling, priority inversion is usually addressed by raising the priority of a process which is holding a resource required by a higher-priority process. But there are no priorities in deadline scheduling, so a variant of this approach is required. The new patch works by "deadline inheritance" - if a process holds a resource required by another process which has a tighter deadline, the holding process has its deadline shortened until the resource is released. It is also necessary to exempt the process from bandwidth throttling (exclusion from the CPU when the stated execution time is exceeded) during this time. That, in turn, could lead to the CPU being oversubscribed - something deadline schedulers are supposed to prevent - but the size of the problem is expected to be small.

The "to do" list for this patch still has a number of entries, including less disruptive bandwidth throttling, a port to the realtime preemption tree, truly global deadline scheduling on multiprocessor systems (another hard problem), and more. The code is progressing, though, and Linux can be expected to have a proper deadline scheduler at some point in the not-too-distant future - though no deadline can be given as the worst case development time is still unknown.

Index entries for this article
KernelRealtime/Deadline scheduling
KernelScheduler/Deadline scheduling


to post comments

A new deadline scheduler patch

Posted Mar 12, 2010 9:15 UTC (Fri) by midg3t (guest, #30998) [Link] (1 responses)

... no deadline can be given as the worst case development time is still unknown.

My co-workers have an old saying that covers estimation on this kind of project: "two years, tops".

A new deadline scheduler patch

Posted Mar 12, 2010 13:53 UTC (Fri) by raistlin (guest, #37586) [Link]

Yeah, and it is even worse since I am not (i.e., I would like very much to but I can't) working it full-time! :-P

Regards,
Dario

A new deadline scheduler patch

Posted Mar 12, 2010 14:09 UTC (Fri) by raistlin (guest, #37586) [Link]

First of all, from me and all the other guys working hard on SCHED_DEADLINE, thanks to our Editor for his interest in our 'baby'! :-D

If this is allowed, just a couple of things and links:
* "a port to the realtime preemption tree"
This has been done, and its available at:
git://gitorious.org/sched_deadline/rt-deadline.git sched-dl

* "including less disruptive bandwidth throttling"
This has been already done as well, and it is again available in project's
repos:
git://gitorious.org/sched_deadline/linux-deadline.git sched-dl
git://gitorious.org/sched_deadline/rt-deadline.git sched-dl

where "sched-dl" is the name of the branch.

Thanks a lot again,
Dario


Copyright © 2010, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds