linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] sched/fair: Remove duplicate code from can_migrate_task()
@ 2014-09-20 16:51 Kirill Tkhai
  2014-09-20 16:51 ` [PATCH 2/7] sched: Fix picking a task switching on other cpu (__ARCH_WANT_UNLOCKED_CTXSW) Kirill Tkhai
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Kirill Tkhai @ 2014-09-20 16:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, Kirill Tkhai

From: Kirill Tkhai <ktkhai@parallels.com>

Two branches do the same, so we can combine them and get
rid of duplicate code.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
---
 kernel/sched/fair.c |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 74fa2c2..fa13f94 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5292,24 +5292,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;
 	}
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-09-21  4:37 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-20 16:51 [PATCH 1/7] sched/fair: Remove duplicate code from can_migrate_task() Kirill Tkhai
2014-09-20 16:51 ` [PATCH 2/7] sched: Fix picking a task switching on other cpu (__ARCH_WANT_UNLOCKED_CTXSW) Kirill Tkhai
2014-09-20 18:33   ` Peter Zijlstra
2014-09-20 18:54     ` Peter Zijlstra
2014-09-20 20:09       ` Kirill Tkhai
2014-09-20 20:19         ` Kirill Tkhai
2014-09-20 19:03     ` Peter Zijlstra
2014-09-20 16:51 ` [PATCH 3/7] sched: Use dl_bw_of() under RCU read lock Kirill Tkhai
2014-09-20 18:57   ` Peter Zijlstra
2014-09-20 19:25     ` Kirill Tkhai
2014-09-20 19:32       ` Peter Zijlstra
2014-09-20 16:51 ` [PATCH 4/7] sched: cleanup: Rename out_unlock to out_free_new_mask Kirill Tkhai
2014-09-20 16:51 ` [PATCH 5/7] sched: Use rq->rd in sched_setaffinity() under RCU read lock Kirill Tkhai
2014-09-20 18:59   ` Peter Zijlstra
2014-09-20 19:05     ` Kirill Tkhai
2014-09-20 19:18       ` Peter Zijlstra
2014-09-20 19:21         ` Kirill Tkhai
2014-09-20 16:51 ` [PATCH 6/7] sched: Delete rq::skip_clock_update == -1 Kirill Tkhai
2014-09-20 19:01   ` Peter Zijlstra
2014-09-21  4:37     ` Mike Galbraith
2014-09-20 16:51 ` [PATCH 7/7] sched/rt: Use resched_curr() in task_tick_rt() Kirill Tkhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).