aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index ad37776cc39b..43e61fa04dc7 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6159,22 +6159,14 @@ __setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio)
6159 BUG_ON(p->se.on_rq); 6159 BUG_ON(p->se.on_rq);
6160 6160
6161 p->policy = policy; 6161 p->policy = policy;
6162 switch (p->policy) {
6163 case SCHED_NORMAL:
6164 case SCHED_BATCH:
6165 case SCHED_IDLE:
6166 p->sched_class = &fair_sched_class;
6167 break;
6168 case SCHED_FIFO:
6169 case SCHED_RR:
6170 p->sched_class = &rt_sched_class;
6171 break;
6172 }
6173
6174 p->rt_priority = prio; 6162 p->rt_priority = prio;
6175 p->normal_prio = normal_prio(p); 6163 p->normal_prio = normal_prio(p);
6176 /* we are holding p->pi_lock already */ 6164 /* we are holding p->pi_lock already */
6177 p->prio = rt_mutex_getprio(p); 6165 p->prio = rt_mutex_getprio(p);
6166 if (rt_prio(p->prio))
6167 p->sched_class = &rt_sched_class;
6168 else
6169 p->sched_class = &fair_sched_class;
6178 set_load_weight(p); 6170 set_load_weight(p);
6179} 6171}
6180 6172