Skip to content

Commit

Permalink
sched/numa: Increment numa_migrate_seq when task runs in correct loca…
Browse files Browse the repository at this point in the history
…tion

When a task is already running on its preferred node, increment
numa_migrate_seq to indicate that the task is settled if migration is
temporarily disabled, and memory should migrate towards it.

Signed-off-by: Rik van Riel <riel@redhat.com>
[ Only increment migrate_seq if migration temporarily disabled. ]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1381141781-10992-35-git-send-email-mgorman@suse.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Rik van Riel authored and Ingo Molnar committed Oct 9, 2013
1 parent 6b9a746 commit 06ea5e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,16 @@ static void numa_migrate_preferred(struct task_struct *p)
{
/* Success if task is already running on preferred CPU */
p->numa_migrate_retry = 0;
if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid)
if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid) {
/*
* If migration is temporarily disabled due to a task migration
* then re-enable it now as the task is running on its
* preferred node and memory should migrate locally
*/
if (!p->numa_migrate_seq)
p->numa_migrate_seq++;
return;
}

/* This task has no NUMA fault statistics yet */
if (unlikely(p->numa_preferred_nid == -1))
Expand Down

0 comments on commit 06ea5e0

Please sign in to comment.