[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e3de300d1212b42aa9d0d6031b12fca06ac00dd9@git.kernel.org>
Date: Thu, 16 Jan 2014 05:40:21 -0800
From: tip-bot for Peter Zijlstra <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, wangyun@...ux.vnet.ibm.com,
tglx@...utronix.de, daniel.lezcano@...aro.org
Subject: [tip:sched/core] sched:
Preserve the nice level over sched_setscheduler() and sched_setparam()
calls
Commit-ID: e3de300d1212b42aa9d0d6031b12fca06ac00dd9
Gitweb: http://git.kernel.org/tip/e3de300d1212b42aa9d0d6031b12fca06ac00dd9
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Wed, 15 Jan 2014 12:30:15 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 16 Jan 2014 09:27:14 +0100
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: Peter Zijlstra <peterz@...radead.org>
Cc: raistlin@...ux.it
Cc: juri.lelli@...il.com
Cc: Michael wang <wangyun@...ux.vnet.ibm.com>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
Fixes: d50dde5a10f3 ("sched: Add new scheduler syscalls to support an extended scheduling parameters ABI")
Link: http://lkml.kernel.org/r/20140115113015.GB31570@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 26af370..c1b3d7e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3451,7 +3451,8 @@ int sched_setscheduler(struct task_struct *p, int policy,
{
struct sched_attr attr = {
.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);
}
@@ -3481,7 +3482,8 @@ int sched_setscheduler_nocheck(struct task_struct *p, int policy,
{
struct sched_attr attr = {
.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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists