Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5085e2a3 authored by Rik van Riel's avatar Rik van Riel Committed by Ingo Molnar
Browse files

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: default avatarRik van Riel <riel@redhat.com>
Tested-by: default avatarVinod Chegu <chegu_vinod@hp.com>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Signed-off-by: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
parent 792568ec
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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. */
/* Attempt to migrate a task to a CPU on the preferred node. */
static void numa_migrate_preferred(struct task_struct *p)
static void numa_migrate_preferred(struct task_struct *p)
{
{
	unsigned long interval = HZ;

	/* This task has no NUMA fault statistics yet */
	/* This task has no NUMA fault statistics yet */
	if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults_memory))
	if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults_memory))
		return;
		return;


	/* Periodically retry migrating the task to the preferred node */
	/* 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 */
	/* Success if task is already running on preferred CPU */
	if (task_node(p) == p->numa_preferred_nid)
	if (task_node(p) == p->numa_preferred_nid)