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_rt.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_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 13de7126a6ab..a4d790cddb19 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -1734,6 +1734,17 @@ static void set_curr_task_rt(struct rq *rq) | |||
1734 | dequeue_pushable_task(rq, p); | 1734 | dequeue_pushable_task(rq, p); |
1735 | } | 1735 | } |
1736 | 1736 | ||
1737 | unsigned int get_rr_interval_rt(struct task_struct *task) | ||
1738 | { | ||
1739 | /* | ||
1740 | * Time slice is 0 for SCHED_FIFO tasks | ||
1741 | */ | ||
1742 | if (task->policy == SCHED_RR) | ||
1743 | return DEF_TIMESLICE; | ||
1744 | else | ||
1745 | return 0; | ||
1746 | } | ||
1747 | |||
1737 | static const struct sched_class rt_sched_class = { | 1748 | static const struct sched_class rt_sched_class = { |
1738 | .next = &fair_sched_class, | 1749 | .next = &fair_sched_class, |
1739 | .enqueue_task = enqueue_task_rt, | 1750 | .enqueue_task = enqueue_task_rt, |
@@ -1762,6 +1773,8 @@ static const struct sched_class rt_sched_class = { | |||
1762 | .set_curr_task = set_curr_task_rt, | 1773 | .set_curr_task = set_curr_task_rt, |
1763 | .task_tick = task_tick_rt, | 1774 | .task_tick = task_tick_rt, |
1764 | 1775 | ||
1776 | .get_rr_interval = get_rr_interval_rt, | ||
1777 | |||
1765 | .prio_changed = prio_changed_rt, | 1778 | .prio_changed = prio_changed_rt, |
1766 | .switched_to = switched_to_rt, | 1779 | .switched_to = switched_to_rt, |
1767 | }; | 1780 | }; |