diff options
author | Kirill Tkhai <ktkhai@parallels.com> | 2014-09-22 22:36:12 +0400 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-12-23 21:15:32 +0800 |
commit | b8849ed88d5ef25eb6986a07c6347461a1e30362 (patch) | |
tree | 313e32c03a631edba80f6f198ff7fcd78bb5692c | |
parent | 2d2dc35f647a679905dddd162ab8b19580a012f9 (diff) |
sched/fair: Remove duplicate code from can_migrate_task()
Combine two branches which do the same.
Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140922183612.11015.64200.stgit@localhost
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 7a96c231ca23f0f5622852307df4209afc502ec3)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | kernel/sched/fair.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8b7c8a280eb..89f667382c1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4264,24 +4264,12 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) */ tsk_cache_hot = task_hot(p, env); - if (migrate_improves_locality(p, env)) { -#ifdef CONFIG_SCHEDSTATS + if (migrate_improves_locality(p, env) || !tsk_cache_hot || + env->sd->nr_balance_failed > env->sd->cache_nice_tries) { 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 || - env->sd->nr_balance_failed > env->sd->cache_nice_tries) { - - if (tsk_cache_hot) { - schedstat_inc(env->sd, lb_hot_gained[env->idle]); - schedstat_inc(p, se.statistics.nr_forced_migrations); - } - return 1; } |