[PATCH 5/5] balancenuma: no task swap in finding placement

From: Hillf Danton
Date: Sat Nov 17 2012 - 00:23:21 EST


Node is selected on behalf of given task, but no reason to punish
the currently running tasks on other nodes. That punishment maybe benifit,
who knows. Better if they are treated not in random way.

Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/kernel/sched/fair.c Sat Nov 17 12:29:08 2012
+++ b/kernel/sched/fair.c Sat Nov 17 12:34:52 2012
@@ -872,7 +872,7 @@ static inline unsigned long balancenuma_

/*
* Examines all other nodes examining remote tasks to see if there would
- * be fewer remote numa faults if tasks swapped home nodes
+ * be fewer remote numa faults
*/
static void task_numa_find_placement(struct task_struct *p)
{
@@ -933,13 +933,6 @@ static void task_numa_find_placement(str
continue;
}

- /* Ensure the other task can be swapped */
- if (!cpumask_test_cpu(this_cpu,
- tsk_cpus_allowed(other_task))) {
- raw_spin_unlock_irq(&rq->lock);
- continue;
- }
-
/*
* Read the fault statistics. If the remote task is a
* thread in the process then use the task statistics.
@@ -973,8 +966,7 @@ compare_other:
this_diff = this_weight - p_weight;

/*
- * Would swapping the tasks reduce the overall
- * cross-node NUMA faults?
+ * Would nid reduce the overall cross-node NUMA faults?
*/
if (other_diff > 0 && this_diff > 0) {
long weight_diff = other_diff + this_diff;
@@ -995,11 +987,8 @@ compare_other:
}
}

- /* Swap the task on the selected target node */
if (selected_nid != -1) {
sched_setnode(p, selected_nid);
- if (selected_task)
- sched_setnode(selected_task, this_nid);
}
}

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