[PATCH] sched/core: restore __setscheduler() behavior

From: Juri Lelli
Date: Sat Mar 01 2014 - 10:43:30 EST


Commit c365c29 introduced __setscheduler_params(), that is now used
to only store a task's new scheduling parameters in the case it is
priority boosted.

Before this change, __setscheduler() was in charge of changing tasks
normal_prio and prio, and the latter is used to actually perform
sched_class change. Unfortunately, the commit above broke this
behavior, causing tasks to remain in fair_sched_class.

Restore the old behaviour setting normal_prio and prio to the right
values after the __setscheduler_params() call.

Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxx>
---
kernel/sched/core.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ee8004c..04ae20d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3206,6 +3206,13 @@ static void __setscheduler(struct rq *rq, struct task_struct *p,
{
__setscheduler_params(p, attr);

+ /*
+ * Since we checked before with rt_mutex_check_prio(),
+ * we don't have pi waiters or our top waiter has lower
+ * priority (user space view) than what we got.
+ */
+ p->prio = p->normal_prio = normal_prio(p);
+
if (dl_prio(p->prio))
p->sched_class = &dl_sched_class;
else if (rt_prio(p->prio))
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/