Code Monkey home page Code Monkey logo

jlelli / linux Goto Github PK

View Code? Open in Web Editor NEW

This project forked from torvalds/linux

0.0 0.0 1.0 4.69 GB

SCHED_DEADLINE. An implementation of the popular Earliest Deadline First (EDF) scheduling algorithm or the Linux kernel. Fork tracking upstream. Intended for further development and issues tracking.

Home Page: https://en.wikipedia.org/wiki/SCHED_DEADLINE

License: Other

Assembly 1.17% C 96.51% Shell 0.22% Awk 0.01% Perl 0.12% Python 0.12% Objective-C 0.27% C++ 1.29% UnrealScript 0.01% Makefile 0.25% Yacc 0.01% Lex 0.01% Roff 0.02% Perl 6 0.01% Gherkin 0.01% XS 0.01% Clojure 0.01% M4 0.01% sed 0.01% SmPL 0.02%

linux's People

Contributors

acmel avatar airlied avatar alexdeucher avatar arndb avatar axellin avatar bigguiness avatar broonie avatar bzolnier avatar danvet avatar davem330 avatar dhowells avatar geertu avatar gregkh avatar htejun avatar ickle avatar jmberg-intel avatar joeperches avatar jwrdegoede avatar larsclausen avatar linusw avatar mchehab avatar morimoto avatar olofj avatar pmundt avatar rafaeljw avatar ralfbaechle avatar rddunlap avatar tiwai avatar torvalds avatar vsyrjala avatar

Watchers

 avatar  avatar  avatar

Forkers

lucabe72

linux's Issues

Is instantaneously removing running bandwidth theoretically wrong?

As done @

if (p->on_rq == TASK_ON_RQ_MIGRATING || flags & DEQUEUE_SAVE) {

we instantaneously remove a task's running and total bandwidth contribution when the task is migrated between CPUs (see also push/pull functions), same also happens when setscheduler/affinity are called (the task in that case is dequeued and enqueued back with different scheduling/affinity parameters).

@lucabe72 shouldn't we wait the 0-lag time?

Implement hierarchical scheduling for SCHED_DEADLINE (H-CBS)

Implement hierarchical RT scheduling by nesting the SCHED_RT fixed-priority scheduler within SCHED_DEADLINE reservations, namely allowing for groups of tasks to be scheduled within a SCHED_DEADLINE reservation, choosing tasks within each group according to their RT priorities.

+-- SCHED_DL scheduler
   +-- SCHED_DL task 1 <rt=..., dl=..., period=...>
   +-- SCHED_DL task 2 <rt=..., dl=..., period=...>
   +-- ...
   +-- SCHED_RT group 1 <rt=..., period=...>
   |  +-- T1 <rtprio=...>
   |  +-- T2 <rtprio=...>
   +-- SCHED_RT group 2 <rt=..., period=...>
   |  +-- T3 <rtprio=...>
   |  +-- T4 <rtprio=...>
   ...

glibc wrapper for sched_{set,get}attr

SCHED_DEADLINE reservation are attached to tasks by using sched_setattr syscall.
However, there is not yet a nice wrapper for it supported by glibc (similar to pthread_setschedparam for example).
Investigate is adding such a wrapper(s) is feasible.

Add cgroup support to SCHED_DEADLINE

A long time ago there was a patch [1] (written by Dario) adding DEADLINE bandwidth management control for task groups. That was then removed from the set of patches that made to mainline because outside of the bare minimum of features to possibly start playing with SCHED_DEADLINE, and because quite some discussion points remained open.
Fast forward to present day and more features have been added, DEADLINE usage is however still reserved to root only. Several things are still missing before we can comfortably relax privileges, bandwidth management for group of tasks being one of the most important (together with a better/safer PI mechanism I'd say).

Another (different) attempt to add cgroup support was proposed last year [2]. The set was implementing hierarchical scheduling support (RT entities running inside DEADLINE servers). Complexity (and maybe not enough documentation? :) made discussion around that proposal difficult to happen.
Even though hierarchical scheduling is still what we want in the end, this set tries to start getting there by adding cgroup based bandwidth management for SCHED_DEADLINE. The following design choices have been made (also detailed in changelog/doc):

  • implementation is not hierarchical: only single/plain DEADLINE entities can be handled, and they get scheduled at root rq level
  • DEADLINE_GROUP_SCHED requires RT_GROUP_SCHED (because of the points below)
  • DEADLINE and RT share bandwidth; therefore, DEADLINE tasks will eat RT bandwidth, as they do today at root level; support for RT_RUNTIME_SHARE is however missing, an RT task might be able to exceed its group bandwidth constrain if such feature is enabled (more thinking required)
  • and therefore cpu.rt_runtime_us and cpu.rt_period_us are still controlling a group bandwidth; however, two additional (read only) knobs are added:
    • cpu.dl_bw: maximum bandwidth available for the group on each CPU (rt_runtime_us/rt_period_us)
    • cpu.dl_total_bw : current total (across CPUs) amount of bandwidth allocated by the group (sum of tasks bandwidth)
  • father/children/siblings rules are the same as for RT

Adding this kind of support should be useful to be able to let normal users use DEADLINE, as the sys admin (with root privileges) could reserve a fraction of the total available bandwidth to users and let
them allocate what needed inside such space.

Allow partitioned EDF

Currently, partitioned EDF can be used only by disabling the admission control or by creating a root domain per CPU (and this will disable migrations for ALL tasks, not only deadline ones!).

We need some way to allow the usage of partitioned scheduling without breaking other tasks migrations or risking starvation (because we disabled admission control). Basically, per-runqueue admission control, with the constraint that deadline tasks must be affine to one single CPU.

Fix deadline inheritance

Current implementation of deadline inheritance is broken (and also dangerous if potentially enabled for non-root users).
Problem is that boosting condition only checks absolute deadline of donor at the time rt_mutex_setprio() is executed and, after that, running task will use donor's parameters for its CBS. However, donor might have smaller bandwidth and longer relative deadline w.r.t. running task. Since running task is enqueued back with ENQUEUE_REPLENISH flag set, it will immediately use donor's parameters and by doing so it might be penalized (w.r.t. continue using its own parameters).
The potential danger for non-root usage comes for the fact that once boosted a task runs outside throttling mechanism (potentially starving lower prio tasks).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.