diff options
author | Peter Williams <pwil3058@bigpond.net.au> | 2009-09-20 21:31:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-21 03:53:55 -0400 |
commit | 0d721ceadbeaa24d7f9dd41b3e5e29912327a7e1 (patch) | |
tree | 54c0c8dc201122483bdd7e8975103b07f6afd34b /kernel/sched.c | |
parent | cb5fd13f1178dee4302646b2890d884c380160e1 (diff) |
sched: Simplify sys_sched_rr_get_interval() system call
By removing the need for it to know details of scheduling classes.
This allows PlugSched to define orthogonal scheduling classes.
Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <06d1b89ee15a0eef82d7.1253496713@mudlark.pw.nest>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1b900fb1c6e1..830967e18285 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -6819,23 +6819,8 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, | |||
6819 | if (retval) | 6819 | if (retval) |
6820 | goto out_unlock; | 6820 | goto out_unlock; |
6821 | 6821 | ||
6822 | /* | 6822 | time_slice = p->sched_class->get_rr_interval(p); |
6823 | * Time slice is 0 for SCHED_FIFO tasks and for SCHED_OTHER | ||
6824 | * tasks that are on an otherwise idle runqueue: | ||
6825 | */ | ||
6826 | time_slice = 0; | ||
6827 | if (p->policy == SCHED_RR) { | ||
6828 | time_slice = DEF_TIMESLICE; | ||
6829 | } else if (p->policy != SCHED_FIFO) { | ||
6830 | struct sched_entity *se = &p->se; | ||
6831 | unsigned long flags; | ||
6832 | struct rq *rq; | ||
6833 | 6823 | ||
6834 | rq = task_rq_lock(p, &flags); | ||
6835 | if (rq->cfs.load.weight) | ||
6836 | time_slice = NS_TO_JIFFIES(sched_slice(&rq->cfs, se)); | ||
6837 | task_rq_unlock(rq, &flags); | ||
6838 | } | ||
6839 | read_unlock(&tasklist_lock); | 6824 | read_unlock(&tasklist_lock); |
6840 | jiffies_to_timespec(time_slice, &t); | 6825 | jiffies_to_timespec(time_slice, &t); |
6841 | retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0; | 6826 | retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0; |