Commit e3de300d authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched: Preserve the nice level over sched_setscheduler() and sched_setparam() calls

Previously sched_setscheduler() and sched_setparam() would not affect
the nice value of a task, restore this behaviour.
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: raistlin@linux.it
Cc: juri.lelli@gmail.com
Cc: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Fixes: d50dde5a ("sched: Add new scheduler syscalls to support an extended scheduling parameters ABI")
Link: http://lkml.kernel.org/r/20140115113015.GB31570@twins.programming.kicks-ass.netSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 5778fccf
...@@ -3451,7 +3451,8 @@ int sched_setscheduler(struct task_struct *p, int policy, ...@@ -3451,7 +3451,8 @@ int sched_setscheduler(struct task_struct *p, int policy,
{ {
struct sched_attr attr = { struct sched_attr attr = {
.sched_policy = policy, .sched_policy = policy,
.sched_priority = param->sched_priority .sched_priority = param->sched_priority,
.sched_nice = PRIO_TO_NICE(p->static_prio),
}; };
return __sched_setscheduler(p, &attr, true); return __sched_setscheduler(p, &attr, true);
} }
...@@ -3481,7 +3482,8 @@ int sched_setscheduler_nocheck(struct task_struct *p, int policy, ...@@ -3481,7 +3482,8 @@ int sched_setscheduler_nocheck(struct task_struct *p, int policy,
{ {
struct sched_attr attr = { struct sched_attr attr = {
.sched_policy = policy, .sched_policy = policy,
.sched_priority = param->sched_priority .sched_priority = param->sched_priority,
.sched_nice = PRIO_TO_NICE(p->static_prio),
}; };
return __sched_setscheduler(p, &attr, false); return __sched_setscheduler(p, &attr, false);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment