diff options
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 01f75a5f17a..db308cb08b7 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -1599,8 +1599,7 @@ static void rq_offline_rt(struct rq *rq) | |||
1599 | * When switch from the rt queue, we bring ourselves to a position | 1599 | * When switch from the rt queue, we bring ourselves to a position |
1600 | * that we might want to pull RT tasks from other runqueues. | 1600 | * that we might want to pull RT tasks from other runqueues. |
1601 | */ | 1601 | */ |
1602 | static void switched_from_rt(struct rq *rq, struct task_struct *p, | 1602 | static void switched_from_rt(struct rq *rq, struct task_struct *p) |
1603 | int running) | ||
1604 | { | 1603 | { |
1605 | /* | 1604 | /* |
1606 | * If there are other RT tasks then we will reschedule | 1605 | * If there are other RT tasks then we will reschedule |
@@ -1609,7 +1608,7 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p, | |||
1609 | * we may need to handle the pulling of RT tasks | 1608 | * we may need to handle the pulling of RT tasks |
1610 | * now. | 1609 | * now. |
1611 | */ | 1610 | */ |
1612 | if (!rq->rt.rt_nr_running) | 1611 | if (p->se.on_rq && !rq->rt.rt_nr_running) |
1613 | pull_rt_task(rq); | 1612 | pull_rt_task(rq); |
1614 | } | 1613 | } |
1615 | 1614 | ||
@@ -1628,8 +1627,7 @@ static inline void init_sched_rt_class(void) | |||
1628 | * with RT tasks. In this case we try to push them off to | 1627 | * with RT tasks. In this case we try to push them off to |
1629 | * other runqueues. | 1628 | * other runqueues. |
1630 | */ | 1629 | */ |
1631 | static void switched_to_rt(struct rq *rq, struct task_struct *p, | 1630 | static void switched_to_rt(struct rq *rq, struct task_struct *p) |
1632 | int running) | ||
1633 | { | 1631 | { |
1634 | int check_resched = 1; | 1632 | int check_resched = 1; |
1635 | 1633 | ||
@@ -1640,7 +1638,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p, | |||
1640 | * If that current running task is also an RT task | 1638 | * If that current running task is also an RT task |
1641 | * then see if we can move to another run queue. | 1639 | * then see if we can move to another run queue. |
1642 | */ | 1640 | */ |
1643 | if (!running) { | 1641 | if (p->se.on_rq && rq->curr != p) { |
1644 | #ifdef CONFIG_SMP | 1642 | #ifdef CONFIG_SMP |
1645 | if (rq->rt.overloaded && push_rt_task(rq) && | 1643 | if (rq->rt.overloaded && push_rt_task(rq) && |
1646 | /* Don't resched if we changed runqueues */ | 1644 | /* Don't resched if we changed runqueues */ |
@@ -1656,10 +1654,13 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p, | |||
1656 | * Priority of the task has changed. This may cause | 1654 | * Priority of the task has changed. This may cause |
1657 | * us to initiate a push or pull. | 1655 | * us to initiate a push or pull. |
1658 | */ | 1656 | */ |
1659 | static void prio_changed_rt(struct rq *rq, struct task_struct *p, | 1657 | static void |
1660 | int oldprio, int running) | 1658 | prio_changed_rt(struct rq *rq, struct task_struct *p, int oldprio) |
1661 | { | 1659 | { |
1662 | if (running) { | 1660 | if (!p->se.on_rq) |
1661 | return; | ||
1662 | |||
1663 | if (rq->curr == p) { | ||
1663 | #ifdef CONFIG_SMP | 1664 | #ifdef CONFIG_SMP |
1664 | /* | 1665 | /* |
1665 | * If our priority decreases while running, we | 1666 | * If our priority decreases while running, we |