aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2014-04-11 13:00:28 -0400
committerIngo Molnar <mingo@kernel.org>2014-05-07 07:33:46 -0400
commit5085e2a328849bdee6650b32d52c87c3788ab01c (patch)
tree315d11c9247c532c7e9800ca23380218cee64f87 /kernel
parent792568ec6a31ca560ca4d528782cbc6cd2cea8b0 (diff)
sched/numa: Retry placement more frequently when misplaced
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> Acked-by: Mel Gorman <mgorman@suse.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1397235629-16328-3-git-send-email-riel@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f6457b63c95c..ecea8d9f957c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1326,12 +1326,15 @@ static int task_numa_migrate(struct task_struct *p)
1326/* Attempt to migrate a task to a CPU on the preferred node. */ 1326/* Attempt to migrate a task to a CPU on the preferred node. */
1327static void numa_migrate_preferred(struct task_struct *p) 1327static void numa_migrate_preferred(struct task_struct *p)
1328{ 1328{
1329 unsigned long interval = HZ;
1330
1329 /* This task has no NUMA fault statistics yet */ 1331 /* This task has no NUMA fault statistics yet */
1330 if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults_memory)) 1332 if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults_memory))
1331 return; 1333 return;
1332 1334
1333 /* Periodically retry migrating the task to the preferred node */ 1335 /* Periodically retry migrating the task to the preferred node */
1334 p->numa_migrate_retry = jiffies + HZ; 1336 interval = min(interval, msecs_to_jiffies(p->numa_scan_period) / 16);
1337 p->numa_migrate_retry = jiffies + interval;
1335 1338
1336 /* Success if task is already running on preferred CPU */ 1339 /* Success if task is already running on preferred CPU */
1337 if (task_node(p) == p->numa_preferred_nid) 1340 if (task_node(p) == p->numa_preferred_nid)