diff options
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 2eb4bd6a526c..a4d790cddb19 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -938,10 +938,13 @@ static void yield_task_rt(struct rq *rq) | |||
938 | #ifdef CONFIG_SMP | 938 | #ifdef CONFIG_SMP |
939 | static int find_lowest_rq(struct task_struct *task); | 939 | static int find_lowest_rq(struct task_struct *task); |
940 | 940 | ||
941 | static int select_task_rq_rt(struct task_struct *p, int sync) | 941 | static int select_task_rq_rt(struct task_struct *p, int sd_flag, int flags) |
942 | { | 942 | { |
943 | struct rq *rq = task_rq(p); | 943 | struct rq *rq = task_rq(p); |
944 | 944 | ||
945 | if (sd_flag != SD_BALANCE_WAKE) | ||
946 | return smp_processor_id(); | ||
947 | |||
945 | /* | 948 | /* |
946 | * If the current task is an RT task, then | 949 | * If the current task is an RT task, then |
947 | * try to see if we can wake this RT task up on another | 950 | * try to see if we can wake this RT task up on another |
@@ -999,7 +1002,7 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p) | |||
999 | /* | 1002 | /* |
1000 | * Preempt the current task with a newly woken task if needed: | 1003 | * Preempt the current task with a newly woken task if needed: |
1001 | */ | 1004 | */ |
1002 | static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int sync) | 1005 | static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flags) |
1003 | { | 1006 | { |
1004 | if (p->prio < rq->curr->prio) { | 1007 | if (p->prio < rq->curr->prio) { |
1005 | resched_task(rq->curr); | 1008 | resched_task(rq->curr); |
@@ -1731,6 +1734,17 @@ static void set_curr_task_rt(struct rq *rq) | |||
1731 | dequeue_pushable_task(rq, p); | 1734 | dequeue_pushable_task(rq, p); |
1732 | } | 1735 | } |
1733 | 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 | |||
1734 | static const struct sched_class rt_sched_class = { | 1748 | static const struct sched_class rt_sched_class = { |
1735 | .next = &fair_sched_class, | 1749 | .next = &fair_sched_class, |
1736 | .enqueue_task = enqueue_task_rt, | 1750 | .enqueue_task = enqueue_task_rt, |
@@ -1759,6 +1773,8 @@ static const struct sched_class rt_sched_class = { | |||
1759 | .set_curr_task = set_curr_task_rt, | 1773 | .set_curr_task = set_curr_task_rt, |
1760 | .task_tick = task_tick_rt, | 1774 | .task_tick = task_tick_rt, |
1761 | 1775 | ||
1776 | .get_rr_interval = get_rr_interval_rt, | ||
1777 | |||
1762 | .prio_changed = prio_changed_rt, | 1778 | .prio_changed = prio_changed_rt, |
1763 | .switched_to = switched_to_rt, | 1779 | .switched_to = switched_to_rt, |
1764 | }; | 1780 | }; |