diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 48c69211888f..5384a977c9a7 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -796,7 +796,8 @@ static void yield_task_fair(struct rq *rq) | |||
796 | static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | 796 | static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) |
797 | { | 797 | { |
798 | struct task_struct *curr = rq->curr; | 798 | struct task_struct *curr = rq->curr; |
799 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); | 799 | struct cfs_rq *cfs_rq = task_cfs_rq(curr), *pcfs_rq; |
800 | struct sched_entity *se = &curr->se, *pse = &p->se; | ||
800 | 801 | ||
801 | if (unlikely(rt_prio(p->prio))) { | 802 | if (unlikely(rt_prio(p->prio))) { |
802 | update_rq_clock(rq); | 803 | update_rq_clock(rq); |
@@ -804,11 +805,21 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
804 | resched_task(curr); | 805 | resched_task(curr); |
805 | return; | 806 | return; |
806 | } | 807 | } |
807 | if (is_same_group(curr, p)) { | ||
808 | s64 delta = curr->se.vruntime - p->se.vruntime; | ||
809 | 808 | ||
810 | if (delta > (s64)sysctl_sched_wakeup_granularity) | 809 | for_each_sched_entity(se) { |
811 | resched_task(curr); | 810 | cfs_rq = cfs_rq_of(se); |
811 | pcfs_rq = cfs_rq_of(pse); | ||
812 | |||
813 | if (cfs_rq == pcfs_rq) { | ||
814 | s64 delta = se->vruntime - pse->vruntime; | ||
815 | |||
816 | if (delta > (s64)sysctl_sched_wakeup_granularity) | ||
817 | resched_task(curr); | ||
818 | break; | ||
819 | } | ||
820 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
821 | pse = pse->parent; | ||
822 | #endif | ||
812 | } | 823 | } |
813 | } | 824 | } |
814 | 825 | ||