All of lore.kernel.org
 help / color / mirror / Atom feed
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, mgorman@suse.de,
	chegu_vinod@hp.com
Subject: [PATCH 3/4] sched,numa: store numa_group's preferred nid
Date: Thu,  8 May 2014 13:23:30 -0400	[thread overview]
Message-ID: <1399569811-14362-4-git-send-email-riel@redhat.com> (raw)
In-Reply-To: <1399569811-14362-1-git-send-email-riel@redhat.com>

From: Rik van Riel <riel@redhat.com>

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@redhat.com>
Tested-by: Chegu Vinod <chegu_vinod@hp.com>
---
 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


  parent reply	other threads:[~2014-05-08 17:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 17:23 [PATCH 0/4] sched,numa: task placement for complex NUMA topologies riel
2014-05-08 17:23 ` [PATCH 1/4] numa,x86: store maximum numa node distance riel
2014-05-09  9:45   ` Peter Zijlstra
2014-05-09 15:08     ` Rik van Riel
2014-05-08 17:23 ` [PATCH 2/4] sched,numa: weigh nearby nodes for task placement on complex NUMA topologies riel
2014-05-09  9:53   ` Peter Zijlstra
2014-05-09 15:14     ` Rik van Riel
2014-05-09  9:54   ` Peter Zijlstra
2014-05-09 10:03   ` Peter Zijlstra
2014-05-09 15:16     ` Rik van Riel
2014-05-09 10:11   ` Peter Zijlstra
2014-05-09 15:11     ` Rik van Riel
2014-05-09 10:13   ` Peter Zijlstra
2014-05-09 15:03     ` Rik van Riel
2014-05-08 17:23 ` riel [this message]
2014-05-08 17:23 ` [PATCH 4/4] sched,numa: pull workloads towards their preferred nodes riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399569811-14362-4-git-send-email-riel@redhat.com \
    --to=riel@redhat.com \
    --cc=chegu_vinod@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.