[PATCH 3/4] sched,numa: store numa_group's preferred nid

From: riel
Date: Thu May 08 2014 - 13:24:44 EST


From: Rik van Riel <riel@xxxxxxxxxx>

Store a numa_group's preferred nid. Used by the next patch to pull
workloads towards their preferred nodes.

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
Tested-by: Chegu Vinod <chegu_vinod@xxxxxx>
---
kernel/sched/fair.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5925667..99cc829 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -864,6 +864,7 @@ struct numa_group {

spinlock_t lock; /* nr_tasks, tasks */
int nr_tasks;
+ int preferred_nid;
pid_t gid;
struct list_head task_list;

@@ -1642,6 +1643,7 @@ static void task_numa_placement(struct task_struct *p)

if (p->numa_group) {
update_numa_active_node_mask(p->numa_group);
+ p->numa_group->preferred_nid = max_group_nid;
/*
* If the preferred task and group nids are different,
* iterate over the nodes again to find the best place.
@@ -1701,6 +1703,7 @@ static void task_numa_group(struct task_struct *p, int cpupid, int flags,
spin_lock_init(&grp->lock);
INIT_LIST_HEAD(&grp->task_list);
grp->gid = p->pid;
+ grp->preferred_nid = -1;
/* Second half of the array tracks nids where faults happen */
grp->faults_cpu = grp->faults + NR_NUMA_HINT_FAULT_TYPES *
nr_node_ids;
--
1.8.5.3

--
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/