lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51650107.9040606@huawei.com>
Date:	Wed, 10 Apr 2013 14:04:55 +0800
From:	Zhang Hang <bob.zhanghang@...wei.com>
To:	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>
CC:	<linux-kernel@...r.kernel.org>
Subject: [PATCH] sched: Remove redundant code from can_migrate_task()

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@...wei.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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ