diff options
author | Kirill Tkhai <ktkhai@parallels.com> | 2014-09-22 14:36:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-09-24 08:47:07 -0400 |
commit | 7a96c231ca23f0f5622852307df4209afc502ec3 (patch) | |
tree | 6bd0677af385cb51b0d596628a1bc31bc22abcee /kernel | |
parent | c55f5158f5606f8a62e694b7e009f59b92ac6258 (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>
Diffstat (limited to 'kernel')
-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 8cb32f83c9b0..10a5a286d8e2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -5315,24 +5315,12 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) | |||
5315 | if (!tsk_cache_hot) | 5315 | if (!tsk_cache_hot) |
5316 | tsk_cache_hot = migrate_degrades_locality(p, env); | 5316 | tsk_cache_hot = migrate_degrades_locality(p, env); |
5317 | 5317 | ||
5318 | if (migrate_improves_locality(p, env)) { | 5318 | if (migrate_improves_locality(p, env) || !tsk_cache_hot || |
5319 | #ifdef CONFIG_SCHEDSTATS | 5319 | env->sd->nr_balance_failed > env->sd->cache_nice_tries) { |
5320 | if (tsk_cache_hot) { | 5320 | if (tsk_cache_hot) { |
5321 | schedstat_inc(env->sd, lb_hot_gained[env->idle]); | 5321 | schedstat_inc(env->sd, lb_hot_gained[env->idle]); |
5322 | schedstat_inc(p, se.statistics.nr_forced_migrations); | 5322 | schedstat_inc(p, se.statistics.nr_forced_migrations); |
5323 | } | 5323 | } |
5324 | #endif | ||
5325 | return 1; | ||
5326 | } | ||
5327 | |||
5328 | if (!tsk_cache_hot || | ||
5329 | env->sd->nr_balance_failed > env->sd->cache_nice_tries) { | ||
5330 | |||
5331 | if (tsk_cache_hot) { | ||
5332 | schedstat_inc(env->sd, lb_hot_gained[env->idle]); | ||
5333 | schedstat_inc(p, se.statistics.nr_forced_migrations); | ||
5334 | } | ||
5335 | |||
5336 | return 1; | 5324 | return 1; |
5337 | } | 5325 | } |
5338 | 5326 | ||