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.zhangh...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to