public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Remove redundant code from can_migrate_task()
@ 2013-04-10  6:04 Zhang Hang
  2013-04-10 10:53 ` [tip:sched/core] sched: Simplify can_migrate_task() tip-bot for Zhang Hang
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Hang @ 2013-04-10  6:04 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel

There is no opportunity to return 1 if tsk_cache_hot is true and the expression
(env->sd->nr_balance_failed > env->sd->cache_nice_tries) is false.
Meanwhile, it's unnecessary to judge whether tsk_cache_hot is true or
false after being filtered by previous judgment.

Signed-off-by: Zhang Hang <bob.zhanghang@huawei.com>
---
 kernel/sched/fair.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7a33e59..4f7e1d0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3929,11 +3929,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
 		return 1;
 	}

-	if (tsk_cache_hot) {
-		schedstat_inc(p, se.statistics.nr_failed_migrations_hot);
-		return 0;
-	}
-	return 1;
+	schedstat_inc(p, se.statistics.nr_failed_migrations_hot);
+	return 0;
 }

 /*
-- 
1.7.8.6


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

end of thread, other threads:[~2013-04-10 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10  6:04 [PATCH] sched: Remove redundant code from can_migrate_task() Zhang Hang
2013-04-10 10:53 ` [tip:sched/core] sched: Simplify can_migrate_task() tip-bot for Zhang Hang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox