From: Henrik Austad <henrik@austad.us>
To: Luca Abeni <luca.abeni@unitn.it>
Cc: Juri Lelli <juri.lelli@gmail.com>,
peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
rostedt@goodmis.org, oleg@redhat.com, fweisbec@gmail.com,
darren@dvhart.com, johan.eker@ericsson.com, p.faure@akatech.ch,
linux-kernel@vger.kernel.org, claudio@evidence.eu.com,
michael@amarulasolutions.com, fchecconi@gmail.com,
tommaso.cucinotta@sssup.it, nicola.manica@disi.unitn.it,
dhaval.giani@gmail.com, hgu1972@gmail.com,
paulmck@linux.vnet.ibm.com, raistlin@linux.it,
insop.song@gmail.com, liming.wang@windriver.com,
jkacur@redhat.com, harald.gustafsson@ericsson.com,
vincent.guittot@linaro.org, bruce.ashfield@windriver.com,
rob@landley.net
Subject: Re: [PATCH] sched/deadline: Add sched_dl documentation
Date: Tue, 21 Jan 2014 11:20:16 +0100 [thread overview]
Message-ID: <20140121102016.GA12002@austad.us> (raw)
In-Reply-To: <52DD2711.9080504@unitn.it>
On Mon, Jan 20, 2014 at 02:39:29PM +0100, Luca Abeni wrote:
> Hi all,
>
> On 01/20/2014 02:16 PM, Henrik Austad wrote:
> [...]
> >>>>+ The typical -deadline task is composed of a computation phase (instance)
> >>>>+ which is activated on a periodic or sporadic fashion. The expected (maximum)
> >>>>+ duration of such computation is called the task's runtime; the time interval
> >>>>+ by which each instance needs to be completed is called the task's relative
> >>>>+ deadline. The task's absolute deadline is dynamically calculated as the
> >>>>+ time instant a task (or, more properly) activates plus the relative
> >>>>+ deadline.
> >>>
> >>>activates - released?
> >>>
> >>
> >>I'd keep (modifying a bit):
> >>
> >>"time instant a task activates plus the relative deadline."
> >>
> >>This is probably the nearest thing to what is implemented that we can say
> >>(without entering into the theory too much), a task that "activates" can mean
> >>that it is first released, enqueued, woken-up, etc.
> >
> >So, if we look at release (yes, I'm avoiding activates for a little while)
> >as the time at the *beginning* of a new period, then, and only then should
> >the *absolute* deadline be computed.
> >
> >If you den move on to use 'activate' as a term for when a task becomes
> >eligble to run, then 'release' becomes a subset of 'activate', and you
> >should only compute the absolute deadline at that time. Did that make
> >sense?
> I think things are a little bit complex here, because there are 2 different
> "deadlines" we can think about:
> - the "jobs deadlines" (the absolute job deadline can be computed at job
> arrival, as the arrival time + the relative deadline). These are generally
> used for performance metrics, to see if a job is respecting its timing
> constraints or not
>
> - the "scheduling deadlines", which are the ones used by the scheduler to
> schedule the tasks. These are computed at tasks' wake-up time - notice that
> for self-suspending jobs there can be wake-up times that are not job arrival
> times. And are assigned according to the rules described in the CBS paper.
>
> I think this can easily become very confusing, so I currently have no concrete
> proposals for improving the documentation... But I wanted to point out that
> things here are more complex than in the "traditional" real-time task model.
Traditional real-time as in the current real-time model used in Linux, or
traditional as in EDF terminology used by Liu & Layland?
> Maybe a solution could be to simply describe scheduling deadlines (which are
> what sched_deadline uses) without going into the details of jobs' deadlines.
Huh?
We definately need a short dictionary. In fact, I'd like to have a
paragraph describing what deadline driven scheduling is.
For instance, I'm getting *Really* confused wrt to arrival time - you seem
to wrap several types of arrival into the same name, yet treat it
differently.
- arrival: when a job gets ready to run for the first time
- arrival: when a job unblocks on some resource
Or did I misunderstand?
So, the terminology I'm used to, an attempt to write up something to
clear up the terminology and establish common grounds. Please
edit/elaborate or shoot down as appropriate:
"""
N. Crashcourse in deadline-terminology:
In a system, we typically look at a set of tasks. In Linux-kernel
terminology, a particular task is normally a thread. When a thread is
ready to run, we say that a *job* of that task is running. It is
perhaps easiest to grasp this if one think only of periodic tasks, i.e. a
thread that need to run for 2ms every 10ms. Normally, we want one job to
finish before a new (of the same task) start, which implies that the
deadline for this task is also 10ms. Once this is clear, expanding one's
mind to aperiodic and/or sporadic tasks is easier.
* Periodic task: a task that needs to run for a while every N us.
* Sporadic task: a tasks that needs tor un for a while at most every N us
(jobs start no closer than N us apart)
* Aperiodic task: a task that have no particular period, but once
released, needs to complete before a given deadline.
* Set of all deadline-tasks in the system: \tau
* One particluar task: \tau_i
* The j'th job of task i: \tau_{i,j}
* The (relative) deadline of task i: D_i
* The (periodic, relative) release time of task i: R_i
* Required execution time a tasks's job needs to complete. C_i
* Absolute release-time, the time when a new job is ready (when a thread is
woken up for a new period).
* The absolute deadline of a job, the actual point in time where a job
needs to be finished. This is what the scheduler looks at when it picks
the next thread to run.
We can now construct a 3-tuple describing a perioic and sporadic tasks:
(C_i, R_i, D_i).
These 3 items is what you can use to describe your task to the scheduler.
"""
> So, the document could avoid talking about instances (or jobs), and can say
> that a task is guaranteed to receive "runtime" time units every "period" time
> units (and these "runtime" time units are available within "deadline" time
> units from the beginning of the period). Every time the task wakes up, the
> scheduler computes a scheduling deadline consistent with this constraint,
> and tasks are scheduled using EDF on these scheduling deadlines.
> Every time "runtime" time units are consumed in a period, the scheduling
> deadline is postponed by a period.
What is wrong with using the CORRECT TERMINOLOGY? People looking at using
sched_deadline _need_ to understand what a _deadline_ scheduler is.
If the only goal of sched_deadline is to act as a bandwidth-gauge, then
fine, but *I* want to use sched_deadline for systems that HAVE DEADLINES. I
do NOT want to mess around with mapping deadlines to priorities in order to
meet my deadlines. I suspect others would like to use sched_deadline for
the same.
> This is of course an approximative description, but I think it can give an
> intuitive idea of how the scheduler works, and about the meaning of the three
> scheduling parameters.
Look, I'm not in favour of turning sched_deadline.txt into an academic
paper, but it is clear that we need to establish a baseline here, and then
we need to include tasks, instances/jobs, deadline, arrival/release and so
on.
--
Henrik Austad
next prev parent reply other threads:[~2014-01-21 10:22 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 10:40 [PATCH] sched/deadline: Add sched_dl documentation Juri Lelli
2014-01-20 11:24 ` Henrik Austad
2014-01-20 11:46 ` Peter Zijlstra
2014-01-21 14:55 ` Steven Rostedt
2014-01-20 12:15 ` Juri Lelli
2014-01-20 13:16 ` Henrik Austad
2014-01-20 13:39 ` Luca Abeni
2014-01-21 10:20 ` Henrik Austad [this message]
2014-01-21 11:35 ` Luca Abeni
2014-01-21 12:11 ` Juri Lelli
2014-01-21 12:33 ` Peter Zijlstra
2014-01-21 12:50 ` Luca Abeni
2014-01-21 13:55 ` Peter Zijlstra
2014-01-21 14:38 ` Juri Lelli
2014-01-21 16:28 ` Steven Rostedt
2014-01-22 13:03 ` Luca Abeni
2014-01-22 13:51 ` Peter Zijlstra
2014-01-24 10:08 ` Tommaso Cucinotta
2014-01-28 9:31 ` Peter Zijlstra
2014-01-28 18:22 ` Tommaso Cucinotta
2014-01-21 10:21 ` Henrik Austad
2014-01-20 12:25 ` Luca Abeni
-- strict thread matches above, loose matches on Subject: below --
2014-01-27 11:20 Juri Lelli
2014-01-27 11:23 ` Juri Lelli
2014-01-27 11:53 ` Henrik Austad
2014-01-27 12:30 ` Luca Abeni
2014-01-27 12:40 ` Henrik Austad
2014-01-27 12:52 ` Luca Abeni
2014-01-27 15:35 ` Steven Rostedt
2014-01-27 16:56 ` Luca Abeni
2014-01-27 17:09 ` Steven Rostedt
2014-01-27 22:29 ` Luca Abeni
2014-01-28 10:03 ` Juri Lelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140121102016.GA12002@austad.us \
--to=henrik@austad.us \
--cc=bruce.ashfield@windriver.com \
--cc=claudio@evidence.eu.com \
--cc=darren@dvhart.com \
--cc=dhaval.giani@gmail.com \
--cc=fchecconi@gmail.com \
--cc=fweisbec@gmail.com \
--cc=harald.gustafsson@ericsson.com \
--cc=hgu1972@gmail.com \
--cc=insop.song@gmail.com \
--cc=jkacur@redhat.com \
--cc=johan.eker@ericsson.com \
--cc=juri.lelli@gmail.com \
--cc=liming.wang@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@unitn.it \
--cc=michael@amarulasolutions.com \
--cc=mingo@redhat.com \
--cc=nicola.manica@disi.unitn.it \
--cc=oleg@redhat.com \
--cc=p.faure@akatech.ch \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=raistlin@linux.it \
--cc=rob@landley.net \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tommaso.cucinotta@sssup.it \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.