Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1309384 > unrolled thread
| Started by | Luca Abeni <luca.abeni@unitn.it> |
|---|---|
| First post | 2016-01-14 16:30 +0100 |
| Last post | 2016-01-15 10:10 +0100 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC 7/8] Make GRUB a task's flag Luca Abeni <luca.abeni@unitn.it> - 2016-01-14 16:30 +0100
Re: [RFC 7/8] Make GRUB a task's flag Peter Zijlstra <peterz@infradead.org> - 2016-01-14 21:00 +0100
Re: [RFC 7/8] Make GRUB a task's flag Luca Abeni <luca.abeni@unitn.it> - 2016-01-15 09:20 +0100
Re: [RFC 7/8] Make GRUB a task's flag Peter Zijlstra <peterz@infradead.org> - 2016-01-15 09:50 +0100
Re: [RFC 7/8] Make GRUB a task's flag Luca Abeni <luca.abeni@unitn.it> - 2016-01-15 10:10 +0100
| From | Luca Abeni <luca.abeni@unitn.it> |
|---|---|
| Date | 2016-01-14 16:30 +0100 |
| Subject | [RFC 7/8] Make GRUB a task's flag |
| Message-ID | <qQS0x-uX-11@gated-at.bofh.it> |
---
include/uapi/linux/sched.h | 1 +
kernel/sched/core.c | 2 +-
kernel/sched/deadline.c | 4 +++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
index cc89dde..9279562 100644
--- a/include/uapi/linux/sched.h
+++ b/include/uapi/linux/sched.h
@@ -48,5 +48,6 @@
* For the sched_{set,get}attr() calls
*/
#define SCHED_FLAG_RESET_ON_FORK 0x01
+#define SCHED_FLAG_RECLAIM 0x02
#endif /* _UAPI_LINUX_SCHED_H */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7ca17e4c..1a384c7 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3911,7 +3911,7 @@ recheck:
return -EINVAL;
}
- if (attr->sched_flags & ~(SCHED_FLAG_RESET_ON_FORK))
+ if (attr->sched_flags & ~(SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_RECLAIM))
return -EINVAL;
/*
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 4795d7f..712cc6d 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -864,7 +864,9 @@ static void update_curr_dl(struct rq *rq)
sched_rt_avg_update(rq, delta_exec);
- delta_exec = grub_reclaim(delta_exec, rq, curr->dl.dl_bw);
+ if (unlikely(dl_se->flags & SCHED_FLAG_RECLAIM)) {
+ delta_exec = grub_reclaim(delta_exec, rq, curr->dl.dl_bw);
+ }
dl_se->runtime -= dl_se->dl_yielded ? 0 : delta_exec;
trace_sched_stat_params_dl(curr, dl_se->runtime, dl_se->deadline);
if (dl_runtime_exceeded(dl_se)) {
--
1.9.1
[toc] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-01-14 21:00 +0100 |
| Message-ID | <qQWdP-3jT-11@gated-at.bofh.it> |
| In reply to | #1309384 |
On Thu, Jan 14, 2016 at 04:24:52PM +0100, Luca Abeni wrote:
> +++ b/include/uapi/linux/sched.h
> @@ -48,5 +48,6 @@
> * For the sched_{set,get}attr() calls
> */
> #define SCHED_FLAG_RESET_ON_FORK 0x01
> +#define SCHED_FLAG_RECLAIM 0x02
With an eye towards unpriv usage of SCHED_DEADLINE, this isn't something
we could allow unpriv tasks, right? Since (IIRC) GRUB will allow eating
all !deadline time.
Something with an average runtime/budget that also puts limits on the
max (say 2*avg) would be far more amenable to be exposed to unpriv
tasks, except since that would directly result in an average tardiness
bound this might be non-trivial to combine with tasks not opting for
this.
[toc] | [prev] | [next] | [standalone]
| From | Luca Abeni <luca.abeni@unitn.it> |
|---|---|
| Date | 2016-01-15 09:20 +0100 |
| Message-ID | <qR7LY-3lR-17@gated-at.bofh.it> |
| In reply to | #1309617 |
On 01/14/2016 08:56 PM, Peter Zijlstra wrote:
> On Thu, Jan 14, 2016 at 04:24:52PM +0100, Luca Abeni wrote:
>> +++ b/include/uapi/linux/sched.h
>> @@ -48,5 +48,6 @@
>> * For the sched_{set,get}attr() calls
>> */
>> #define SCHED_FLAG_RESET_ON_FORK 0x01
>> +#define SCHED_FLAG_RECLAIM 0x02
>
> With an eye towards unpriv usage of SCHED_DEADLINE, this isn't something
> we could allow unpriv tasks, right? Since (IIRC) GRUB will allow eating
> all !deadline time.
The original algorithm, yes, it allowed to use 100% of the CPU time, starving
all !deadline tasks.
But in this patchset I modified the algorithm to allow reclaiming only a
fraction U_max of the CPU time... So, 1-U_max can be left free for !deadline.
> Something with an average runtime/budget that also puts limits on the
> max (say 2*avg) would be far more amenable to be exposed to unpriv
> tasks, except since that would directly result in an average tardiness
> bound this might be non-trivial to combine with tasks not opting for
> this.
I'll try to think about this... The advantage of GRUB is that a theoretically
sound algorithm already existed; here, we would need to design the algorithm
so that it does not break the SCHED_DEADLINE guarantees. Anyway, this is an
interesting challenge, I'll work on it :)
Thanks,
Luca
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-01-15 09:50 +0100 |
| Message-ID | <qR8f0-3AL-21@gated-at.bofh.it> |
| In reply to | #1309945 |
On Fri, Jan 15, 2016 at 09:15:39AM +0100, Luca Abeni wrote: > On 01/14/2016 08:56 PM, Peter Zijlstra wrote: > >Something with an average runtime/budget that also puts limits on the > >max (say 2*avg) would be far more amenable to be exposed to unpriv > >tasks, except since that would directly result in an average tardiness > >bound this might be non-trivial to combine with tasks not opting for > >this. > I'll try to think about this... The advantage of GRUB is that a theoretically > sound algorithm already existed; here, we would need to design the algorithm > so that it does not break the SCHED_DEADLINE guarantees. Anyway, this is an > interesting challenge, I'll work on it :) Didn't Baruah and Jim do the whole theory on statistical EDF? Which shows that if you use a statistical budget the combined distribution transfers to the tardiness. With stdev=0 for the budgets this trivially collapses to the regular EDF, since then the combined distribution is also stdev=0 and you get 0 tardiness (on UP). But yes, combining the two into one scheduler is 'interesting'. I was thinking it would be possible with least-laxity-first, since you can assign the hard (stdev=0) tasks a tighter laxity bound. But LLF is horrendously painful to implement IIRC.
[toc] | [prev] | [next] | [standalone]
| From | Luca Abeni <luca.abeni@unitn.it> |
|---|---|
| Date | 2016-01-15 10:10 +0100 |
| Message-ID | <qR8ym-3Yi-13@gated-at.bofh.it> |
| In reply to | #1309962 |
On Fri, 15 Jan 2016 09:41:50 +0100 Peter Zijlstra <peterz@infradead.org> wrote: > On Fri, Jan 15, 2016 at 09:15:39AM +0100, Luca Abeni wrote: > > On 01/14/2016 08:56 PM, Peter Zijlstra wrote: > > > >Something with an average runtime/budget that also puts limits on > > >the max (say 2*avg) would be far more amenable to be exposed to > > >unpriv tasks, except since that would directly result in an > > >average tardiness bound this might be non-trivial to combine with > > >tasks not opting for this. > > > I'll try to think about this... The advantage of GRUB is that a > > theoretically sound algorithm already existed; here, we would need > > to design the algorithm so that it does not break the > > SCHED_DEADLINE guarantees. Anyway, this is an interesting > > challenge, I'll work on it :) > > Didn't Baruah and Jim do the whole theory on statistical EDF? Which > shows that if you use a statistical budget the combined distribution > transfers to the tardiness. With stdev=0 for the budgets this > trivially collapses to the regular EDF, since then the combined > distribution is also stdev=0 and you get 0 tardiness (on UP). I remember a paper by Anderson, but it was slightly different from this... Maybe I am remembering the wrong paper... I'll check it again. > But yes, combining the two into one scheduler is 'interesting'. I was > thinking it would be possible with least-laxity-first, since you can > assign the hard (stdev=0) tasks a tighter laxity bound. > > But LLF is horrendously painful to implement IIRC. LLF would be interesting (even because if would help in implementing an optimal SMP scheduler), but yes, it is not simple to implement (at least, as far as I remember). I had a student working on it, who implemented some kind of LLF approximation, but I still have to cleanup the code and see how much useful it can be). Thanks, Luca
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web