Skip to content

Commit

Permalink
sched/fair: Remove duplicate code from can_migrate_task()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kirill Tkhai authored and Ingo Molnar committed Sep 24, 2014
1 parent c55f515 commit 7a96c23
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -5315,24 +5315,12 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
if (!tsk_cache_hot)
tsk_cache_hot = migrate_degrades_locality(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;
}

Expand Down

0 comments on commit 7a96c23

Please sign in to comment.