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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 12 Oct 2012 04:27:45 -0700
From:	tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
	a.p.zijlstra@...llo.nl, tglx@...utronix.de
Subject: [tip:sched/numa] sched/numa: Don'
 t consider numa-hot for idle balance

Commit-ID:  39f5d872513adaf8790f12eef8bac54c902f1f77
Gitweb:     http://git.kernel.org/tip/39f5d872513adaf8790f12eef8bac54c902f1f77
Author:     Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Fri, 5 Oct 2012 15:57:54 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 12 Oct 2012 12:07:17 +0200

sched/numa: Don't consider numa-hot for idle balance

Reducing idle time is far more important than keeping numa tasks on
their preferred node.

The fact that NEW_IDLE balance doesn't increase nr_balance_failed only
makes it worse.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/n/tip-3pzp0o6gemhb8t7fj8shscpo@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/sched/fair.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 60be6bf..092287e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3410,7 +3410,7 @@ static void move_task(struct task_struct *p, struct lb_env *env)
 	check_preempt_curr(env->dst_rq, p, 0);
 }
 
-static int task_numa_hot(struct task_struct *p, int from_cpu, int to_cpu)
+static int task_numa_hot(struct task_struct *p, struct lb_env *env)
 {
 	int from_dist, to_dist;
 	int node = tsk_home_node(p);
@@ -3418,8 +3418,8 @@ static int task_numa_hot(struct task_struct *p, int from_cpu, int to_cpu)
 	if (!sched_feat_numa(NUMA_HOT) || node == -1)
 		return 0; /* no node preference */
 
-	from_dist = node_distance(cpu_to_node(from_cpu), node);
-	to_dist = node_distance(cpu_to_node(to_cpu), node);
+	from_dist = node_distance(cpu_to_node(env->src_cpu), node);
+	to_dist = node_distance(cpu_to_node(env->dst_cpu), node);
 
 	if (to_dist < from_dist)
 		return 0; /* getting closer is ok */
@@ -3431,7 +3431,7 @@ static int task_numa_hot(struct task_struct *p, int from_cpu, int to_cpu)
  * Is this task likely cache-hot:
  */
 static int
-task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
+task_hot(struct task_struct *p, struct lb_env *env)
 {
 	s64 delta;
 
@@ -3454,7 +3454,7 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
 	if (sysctl_sched_migration_cost == 0)
 		return 0;
 
-	delta = now - p->se.exec_start;
+	delta = env->src_rq->clock_task - p->se.exec_start;
 
 	return delta < (s64)sysctl_sched_migration_cost;
 }
@@ -3511,8 +3511,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
 	 * 2) too many balance attempts have failed.
 	 */
 
-	tsk_cache_hot = task_hot(p, env->src_rq->clock_task, env->sd);
-	tsk_cache_hot |= task_numa_hot(p, env->src_cpu, env->dst_cpu);
+	tsk_cache_hot = task_hot(p, env);
+	if (env->idle == CPU_NOT_IDLE)
+		tsk_cache_hot |= task_numa_hot(p, env);
 	if (!tsk_cache_hot ||
 		env->sd->nr_balance_failed > env->sd->cache_nice_tries) {
 #ifdef CONFIG_SCHEDSTATS
--
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