mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, chegu_vinod@hp.com,
	mgorman@suse.de
Subject: [PATCH 2/3] sched,numa: retry placement more frequently when misplaced
Date: Fri, 11 Apr 2014 13:00:28 -0400	[thread overview]
Message-ID: <1397235629-16328-3-git-send-email-riel@redhat.com> (raw)
In-Reply-To: <1397235629-16328-1-git-send-email-riel@redhat.com>

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

When tasks have not converged on their preferred nodes yet, we want
to retry fairly often, to make sure we do not migrate a task's memory
to an undesirable location, only to have to move it again later.

This patch reduces the interval at which migration is retried,
when the task's numa_scan_period is small.

Signed-off-by: Rik van Riel <riel@redhat.com>
Tested-by: Vinod Chegu <chegu_vinod@hp.com>
---
 kernel/sched/fair.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 12de50a..babd316 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1326,12 +1326,15 @@ static int task_numa_migrate(struct task_struct *p)
 /* Attempt to migrate a task to a CPU on the preferred node. */
 static void numa_migrate_preferred(struct task_struct *p)
 {
+	unsigned long interval = HZ;
+
 	/* This task has no NUMA fault statistics yet */
 	if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults_memory))
 		return;
 
 	/* Periodically retry migrating the task to the preferred node */
-	p->numa_migrate_retry = jiffies + HZ;
+	interval = min(interval, msecs_to_jiffies(p->numa_scan_period) / 16);
+	p->numa_migrate_retry = jiffies + interval;
 
 	/* Success if task is already running on preferred CPU */
 	if (task_node(p) == p->numa_preferred_nid)
-- 
1.8.5.3


  parent reply	other threads:[~2014-04-11 17:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 17:00 [PATCH 0/3] sched,numa: reduce page migrations with pseudo-interleaving riel
2014-04-11 17:00 ` [PATCH 1/3] sched,numa: count pages on active node as local riel
2014-04-11 17:34   ` Joe Perches
2014-04-11 17:41     ` Rik van Riel
2014-04-11 18:01       ` Joe Perches
2014-04-25  9:04   ` Mel Gorman
2014-05-08 10:42   ` [tip:sched/core] sched/numa: Count " tip-bot for Rik van Riel
2014-04-11 17:00 ` riel [this message]
2014-04-11 17:46   ` [PATCH 2/3] sched,numa: retry placement more frequently when misplaced Joe Perches
2014-04-11 18:03     ` Rik van Riel
2014-04-14  8:19       ` Ingo Molnar
2014-04-25  9:05   ` Mel Gorman
2014-05-08 10:42   ` [tip:sched/core] sched/numa: Retry " tip-bot for Rik van Riel
2014-04-11 17:00 ` [PATCH 3/3] sched,numa: do not set preferred_node on migration to a second choice node riel
2014-04-14 12:56   ` Peter Zijlstra
2014-04-15 14:35     ` Rik van Riel
2014-04-15 16:51       ` Peter Zijlstra
2014-04-25  9:09   ` Mel Gorman
2014-05-08 10:43   ` [tip:sched/core] sched/numa: Do " tip-bot for Rik van 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=1397235629-16328-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome