mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Luca Abeni <luca.abeni@unitn.it>
Cc: Henrik Austad <henrik@austad.us>,
	Juri Lelli <juri.lelli@gmail.com>,
	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: Wed, 22 Jan 2014 14:51:59 +0100	[thread overview]
Message-ID: <20140122135159.GQ31570@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <52DFC196.7020301@unitn.it>

On Wed, Jan 22, 2014 at 02:03:18PM +0100, Luca Abeni wrote:
> >At which point I feel obliged to mention the work Jim did on statistical
> >bounded tardiness and a potential future option:
> >SCHED_FLAG_DL_AVG_RUNTIME, where we would allow tasks to somewhat exceed
> >their runtime budget provided that they meet their budget on average.

> I think I read the paper your refer to, and if I remember well it was about
> an analysis technique (using some math from queuing theory to get estimations
> of the average response time, and then using Tchebysheff to transform this result
> in a probabilistic real-time guarantee)... If I understand well, it does not
> require modifications to the scheduling algorithm (the paper presents a multiprocessor
> reservation-based scheduling algorithm, but the presented analysis applies to every
> reservation-based algorithm, including SCHED_DEADLINE without modifications).
> Am I misunderstanding something?

I must admit to not actually having read that paper; Jim talked me
through the result at some time, but yes that sounds about right.

The only thing we need to do is enforce some 'avg' on the input
(scheduling parameters) such that we are guaranteed an avg on the output
(tardiness).

And we must enforce the input because we cannot trust userspace to
actually do what it says; if it were to go overboard we'd loose all
bounds.

> Anyway, I'll propose a documentation patch adding this paper to the references
> (and if you agree I can also add some other references to probabilistic guarantees).

Right, something for the future though.

> The SCHED_FLAG_DL_AVG_RUNTIME idea also looks interesting.

Right, like said above, because we cannot trust userspace we must
enforce that the input is indeed a bounded avg, otherwise the guarantees
do not hold.

> >Another possibly extension; one proposed by Ingo; is to demote tasks to
> >SCHED_OTHER once they exceed their budget instead of the full block they
> >get now -- we could possibly call this SCHED_FLAG_DL_CBS_SOFT or such.

> I think something similar to this was mentioned in the original "resource kernels"
> paper by Rajkumar and others... It is in general very useful.

Right, esp. so when we allow unpriv. access to SCHED_DEADLINE, more on
that below.

> Another extension I implemented "locally" (but I never submitted patches because
> it is "dangerous" and potentially controversial) is the original CBS behaviour:
> when a task is depleted, do not make it unschedulable, but just postpone its
> scheduling deadline (decreasing its priority) and immediately recharge the
> runtime. This still preserves temporal isolation between SCHED_DEADLINE tasks,
> but can cause starvation of non-SCHED_DEADLINE tasks (and this is why I say this
> is dangerous and can be controversial), but can be useful in some situations.

Right, we could actually implement that but always require CAP_ADMIN if
set.

We should also again talk about what it would take to allow
unprivileged access to SCHED_DEADLINE. The things I can remember are the
obvious cap on utilization and a minimum period -- the latter so that we
don't DoS the system with a metric ton of tiny tasks.

But I seem to remember there were a few other issues.

> 
> >And of course SCHED_FLAG_DL_CBS_SIGNAL, where the task gets a signal
> >delivered if it exceeded the runtime -- I think some of the earlier
> >patches had things like this, no?
> I've seen this in some patchset, but I do not remember when. I think some of
> the "advanced features" have been removed from the first submission.

Exactly, so. Now that we have the simple stuff settled, we can again
look at the more advanced features if there's potential users.

  reply	other threads:[~2014-01-22 13:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 10:40 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
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 [this message]
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
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=20140122135159.GQ31570@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --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=henrik@austad.us \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome