aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorZhang Hang <bob.zhanghang@huawei.com>2013-04-10 02:04:55 -0400
committerIngo Molnar <mingo@kernel.org>2013-04-10 05:15:45 -0400
commit4e2dcb73aecbde9fe4e3137c9ea35cb6aa6cb286 (patch)
treed3011ead0af5e93ae0312ddf448dd6caae3a0cd3 /kernel/sched/fair.c
parent28b4a521f618d9722bc780ea38b44718ce0fe283 (diff)
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/fair.c')
-rw-r--r--kernel/sched/fair.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 539760ef00c4..bf8ab4f5e603 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)
3921 tsk_cache_hot = task_hot(p, env->src_rq->clock_task, env->sd); 3921 tsk_cache_hot = task_hot(p, env->src_rq->clock_task, env->sd);
3922 if (!tsk_cache_hot || 3922 if (!tsk_cache_hot ||
3923 env->sd->nr_balance_failed > env->sd->cache_nice_tries) { 3923 env->sd->nr_balance_failed > env->sd->cache_nice_tries) {
3924#ifdef CONFIG_SCHEDSTATS 3924
3925 if (tsk_cache_hot) { 3925 if (tsk_cache_hot) {
3926 schedstat_inc(env->sd, lb_hot_gained[env->idle]); 3926 schedstat_inc(env->sd, lb_hot_gained[env->idle]);
3927 schedstat_inc(p, se.statistics.nr_forced_migrations); 3927 schedstat_inc(p, se.statistics.nr_forced_migrations);
3928 } 3928 }
3929#endif 3929
3930 return 1; 3930 return 1;
3931 } 3931 }
3932 3932
3933 if (tsk_cache_hot) { 3933 schedstat_inc(p, se.statistics.nr_failed_migrations_hot);
3934 schedstat_inc(p, se.statistics.nr_failed_migrations_hot); 3934 return 0;
3935 return 0;
3936 }
3937 return 1;
3938} 3935}
3939 3936
3940/* 3937/*