diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-05-12 16:50:34 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-22 04:21:26 -0400 |
commit | ce5f7f8200ca2504f6f290044393d73ca314965a (patch) | |
tree | c82c7cb66b268676f8da0e3801c5ce1240ce693c | |
parent | dbdb22754fde671dc93d2fae06f8be113d47f2fb (diff) |
sched/deadline: Change sched_getparam() behaviour vs SCHED_DEADLINE
The way we read POSIX one should only call sched_getparam() when
sched_getscheduler() returns either SCHED_FIFO or SCHED_RR.
Given that we currently return sched_param::sched_priority=0 for all
others, extend the same behaviour to SCHED_DEADLINE.
Requested-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Dario Faggioli <raistlin@linux.it>
Cc: linux-man <linux-man@vger.kernel.org>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Juri Lelli <juri.lelli@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20140512205034.GH13467@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index cdefcf7c5925..f3f08bf94355 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3713,7 +3713,7 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) | |||
3713 | */ | 3713 | */ |
3714 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) | 3714 | SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) |
3715 | { | 3715 | { |
3716 | struct sched_param lp; | 3716 | struct sched_param lp = { .sched_priority = 0 }; |
3717 | struct task_struct *p; | 3717 | struct task_struct *p; |
3718 | int retval; | 3718 | int retval; |
3719 | 3719 | ||
@@ -3730,11 +3730,8 @@ SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) | |||
3730 | if (retval) | 3730 | if (retval) |
3731 | goto out_unlock; | 3731 | goto out_unlock; |
3732 | 3732 | ||
3733 | if (task_has_dl_policy(p)) { | 3733 | if (task_has_rt_policy(p)) |
3734 | retval = -EINVAL; | 3734 | lp.sched_priority = p->rt_priority; |
3735 | goto out_unlock; | ||
3736 | } | ||
3737 | lp.sched_priority = p->rt_priority; | ||
3738 | rcu_read_unlock(); | 3735 | rcu_read_unlock(); |
3739 | 3736 | ||
3740 | /* | 3737 | /* |