diff options
author | Zhang Hang <bob.zhanghang@huawei.com> | 2013-04-10 06:04:55 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-10 09:15:45 (GMT) |
commit | 4e2dcb73aecbde9fe4e3137c9ea35cb6aa6cb286 (patch) | |
tree | d3011ead0af5e93ae0312ddf448dd6caae3a0cd3 /kernel/sched | |
parent | 28b4a521f618d9722bc780ea38b44718ce0fe283 (diff) | |
download | linux-fsl-qoriq-4e2dcb73aecbde9fe4e3137c9ea35cb6aa6cb286.tar.xz |
sched: Simplify can_migrate_task()
At this point tsk_cache_hot is always true, so no need to check it.
Signed-off-by: Zhang Hang <bob.zhanghang@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51650107.9040606@huawei.com
[ Also remove unnecessary schedstat #ifdefs. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 539760e..bf8ab4f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3921,20 +3921,17 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) tsk_cache_hot = task_hot(p, env->src_rq->clock_task, env->sd); if (!tsk_cache_hot || env->sd->nr_balance_failed > env->sd->cache_nice_tries) { -#ifdef CONFIG_SCHEDSTATS + if (tsk_cache_hot) { schedstat_inc(env->sd, lb_hot_gained[env->idle]); schedstat_inc(p, se.statistics.nr_forced_migrations); } -#endif + return 1; } - if (tsk_cache_hot) { - schedstat_inc(p, se.statistics.nr_failed_migrations_hot); - return 0; - } - return 1; + schedstat_inc(p, se.statistics.nr_failed_migrations_hot); + return 0; } /* |