[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160227123757.36cee2d3@utopia>
Date: Sat, 27 Feb 2016 12:37:57 +0100
From: luca abeni <luca.abeni@...tn.it>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Juri Lelli <juri.lelli@....com>, linux-kernel@...r.kernel.org
Subject: Re: Question about prio_changed_dl()
On Thu, 25 Feb 2016 15:52:02 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> On Thu, Feb 25, 2016 at 03:25:58PM +0100, luca abeni wrote:
>
> > > > (BTW, it seems to me that switched_to_dl() is never invoked, for
> > > > some reason...)
> > >
> > > Hmm, it should be invoked if you do sched_setattr() to get
> > > SCHED_DEADLINE.
> >
> > Sorry, that was me being confused...
> > It is prio_changed_dl() that is not invoked when the deadline
> > parameters are changed (I am testing a change to fix this - it actually
> > is included in the "Move the remaining __dl_{sub,add}_ac() calls from
> > core.c to deadline.c" patch I posted on Monday; I am going to extract
> > it in a separate patch).
>
> Ah ok. So the idea was that the || dl_task() part would ensure
> ->prio_changed() would always be called.
>
> I'll await your patch.
>From 5a0bde5332bc1cc5701b2d9799f6ec197c1572cc Mon Sep 17 00:00:00 2001
From: Luca Abeni <luca.abeni@...tn.it>
Date: Fri, 26 Feb 2016 09:56:24 +0100
Subject: sched/core: fix __sched_setscheduler() to properly invoke prio_changed_dl()
Currently, prio_changed_dl() is not called when __sched_setscheduler()
changes the parameters of a SCHED_DEADLINE task. This happens because
when changing parameters deadline tasks do not change their priority,
so new_effective_prio == oldprio.
The issue is fixed by explicitly checking if the task is a deadline task.
Signed-off-by: Luca Abeni <luca.abeni@...tn.it>
---
kernel/sched/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9503d59..5646bde 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4079,6 +4079,8 @@ change:
new_effective_prio = rt_mutex_get_effective_prio(p, newprio);
if (new_effective_prio == oldprio) {
__setscheduler_params(p, attr);
+ if (p->sched_class == &dl_sched_class)
+ p->sched_class->prio_changed(rq, p, oldprio);
task_rq_unlock(rq, p, &flags);
return 0;
}
--
2.5.0
Powered by blists - more mailing lists