diff options
-rw-r--r-- | kernel/sched_fair.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index d558716a9add..6c361472cc74 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -837,7 +837,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
837 | struct task_struct *curr = rq->curr; | 837 | struct task_struct *curr = rq->curr; |
838 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); | 838 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); |
839 | struct sched_entity *se = &curr->se, *pse = &p->se; | 839 | struct sched_entity *se = &curr->se, *pse = &p->se; |
840 | s64 delta, gran; | 840 | unsigned long gran; |
841 | 841 | ||
842 | if (unlikely(rt_prio(p->prio))) { | 842 | if (unlikely(rt_prio(p->prio))) { |
843 | update_rq_clock(rq); | 843 | update_rq_clock(rq); |
@@ -860,12 +860,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
860 | pse = parent_entity(pse); | 860 | pse = parent_entity(pse); |
861 | } | 861 | } |
862 | 862 | ||
863 | delta = se->vruntime - pse->vruntime; | ||
864 | gran = sysctl_sched_wakeup_granularity; | 863 | gran = sysctl_sched_wakeup_granularity; |
865 | if (unlikely(se->load.weight != NICE_0_LOAD)) | 864 | if (unlikely(se->load.weight != NICE_0_LOAD)) |
866 | gran = calc_delta_fair(gran, &se->load); | 865 | gran = calc_delta_fair(gran, &se->load); |
867 | 866 | ||
868 | if (delta > gran) | 867 | if (pse->vruntime + gran < se->vruntime) |
869 | resched_task(curr); | 868 | resched_task(curr); |
870 | } | 869 | } |
871 | 870 | ||