sched: Remove redundant test in check_preempt_tick()

The caller already checks for nr_running > 1, therefore we don't have
to do so again.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Reviewed-by: Paul Turner <pjt@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1316194552-12019-1-git-send-email-xingchao.wang@intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Wang Xingchao 2011-09-16 13:35:52 -04:00 committed by Ingo Molnar
parent bfa322c48d
commit f4cfb33ed9
1 changed files with 8 additions and 8 deletions

View File

@ -1106,6 +1106,8 @@ static void
check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
{ {
unsigned long ideal_runtime, delta_exec; unsigned long ideal_runtime, delta_exec;
struct sched_entity *se;
s64 delta;
ideal_runtime = sched_slice(cfs_rq, curr); ideal_runtime = sched_slice(cfs_rq, curr);
delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
@ -1127,16 +1129,14 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
if (delta_exec < sysctl_sched_min_granularity) if (delta_exec < sysctl_sched_min_granularity)
return; return;
if (cfs_rq->nr_running > 1) { se = __pick_first_entity(cfs_rq);
struct sched_entity *se = __pick_first_entity(cfs_rq); delta = curr->vruntime - se->vruntime;
s64 delta = curr->vruntime - se->vruntime;
if (delta < 0) if (delta < 0)
return; return;
if (delta > ideal_runtime) if (delta > ideal_runtime)
resched_task(rq_of(cfs_rq)->curr); resched_task(rq_of(cfs_rq)->curr);
}
} }
static void static void