sched/core: fix __sched_setscheduler() to properly invoke prio_changed_dl()

From: Luca Abeni
Date: Fri Feb 26 2016 - 03:56:24 EST


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@xxxxxxxx>
---
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