mm: numa: Change page last {nid,pid} into {cpu,pid}

Change the per page last fault tracking to use cpu,pid instead of
nid,pid. This will allow us to try and lookup the alternate task more
easily. Note that even though it is the cpu that is store in the page
flags that the mpol_misplaced decision is still based on the node.

Signed-off-by: Peter Zijlstra <[email protected]>
Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Srikar Dronamraju <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ Fixed build failure on 32-bit systems. ]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Peter Zijlstra 2013-10-07 11:29:20 +01:00 • committed by Ingo Molnar
commit 90572890d2
13 changed files with 125 additions and 109 deletions

View file

@ -1210,7 +1210,7 @@ static void task_numa_placement(struct task_struct *p)
/*
* Got a PROT_NONE fault for a page on @node.
*/
void task_numa_fault(int last_nidpid, int node, int pages, bool migrated)
void task_numa_fault(int last_cpupid, int node, int pages, bool migrated)
{
struct task_struct *p = current;
int priv;
@ -1226,8 +1226,8 @@ void task_numa_fault(int last_nidpid, int node, int pages, bool migrated)
* First accesses are treated as private, otherwise consider accesses
* to be private if the accessing pid has not changed
*/
if (!nidpid_pid_unset(last_nidpid))
priv = ((p->pid & LAST__PID_MASK) == nidpid_to_pid(last_nidpid));
if (!cpupid_pid_unset(last_cpupid))
priv = ((p->pid & LAST__PID_MASK) == cpupid_to_pid(last_cpupid));
else
priv = 1;