|
@@ -3172,15 +3172,23 @@ static void __setscheduler(struct rq *rq, struct task_struct *p,
|
|
{
|
|
{
|
|
int policy = attr->sched_policy;
|
|
int policy = attr->sched_policy;
|
|
|
|
|
|
|
|
+ if (policy == -1) /* setparam */
|
|
|
|
+ policy = p->policy;
|
|
|
|
+
|
|
p->policy = policy;
|
|
p->policy = policy;
|
|
|
|
|
|
if (dl_policy(policy))
|
|
if (dl_policy(policy))
|
|
__setparam_dl(p, attr);
|
|
__setparam_dl(p, attr);
|
|
- else if (rt_policy(policy))
|
|
|
|
- p->rt_priority = attr->sched_priority;
|
|
|
|
- else
|
|
|
|
|
|
+ else if (fair_policy(policy))
|
|
p->static_prio = NICE_TO_PRIO(attr->sched_nice);
|
|
p->static_prio = NICE_TO_PRIO(attr->sched_nice);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * __sched_setscheduler() ensures attr->sched_priority == 0 when
|
|
|
|
+ * !rt_policy. Always setting this ensures that things like
|
|
|
|
+ * getparam()/getattr() don't report silly values for !rt tasks.
|
|
|
|
+ */
|
|
|
|
+ p->rt_priority = attr->sched_priority;
|
|
|
|
+
|
|
p->normal_prio = normal_prio(p);
|
|
p->normal_prio = normal_prio(p);
|
|
p->prio = rt_mutex_getprio(p);
|
|
p->prio = rt_mutex_getprio(p);
|
|
|
|
|