mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: Make sure task has correct sched_class after policy change
@ 2009-09-23  2:21 Peter Williams
  2009-09-23  6:32 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Williams @ 2009-09-23  2:21 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Mike Galbraith, Linux Kernel Mailing

>From the code in rt_mutex_setprio(), it is evident that the intention
is that task's with a RT 'prio' value as a consequence of receiving a PI
boost also have their 'sched_class' field set to '&rt_sched_class'.
However, the code in __setscheduler() could result in this intention
being frustrated.

This patch fixes this problem.

Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>

diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6159,6 +6159,8 @@ __setscheduler(struct rq *rq, struct tas
 	p->normal_prio = normal_prio(p);
 	/* we are holding p->pi_lock already */
 	p->prio = rt_mutex_getprio(p);
+	if (rt_prio(p->prio))
+		p->sched_class = &rt_sched_class;
 	set_load_weight(p);
 }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-14 13:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23  2:21 [PATCH] sched: Make sure task has correct sched_class after policy change Peter Williams
2009-09-23  6:32 ` Peter Zijlstra
2009-09-23 12:40   ` Peter Williams
2009-10-12  0:36     ` Peter Williams
2009-10-12 15:34       ` Peter Zijlstra
2009-10-14 13:13   ` [tip:sched/urgent] " tip-bot for Peter Zijlstra

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