aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorWanpeng Li2013-12-12 15:23:25 +0800
committerIngo Molnar2013-12-17 15:24:40 +0100
commit82897b4fd3920ffd2456731d4f2ae1406558ef4c (patch)
treee588319efc67d5b933745320a558fd1407280136 /kernel/sched
parentde1b301a19754778ddd9f908d266ffe1c010b2cf (diff)
sched/numa: Use wrapper function task_faults_idx to calculate index in group_faults
Use wrapper function task_faults_idx to calculate index in group_faults. Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Acked-by: Mel Gorman <mgorman@suse.de> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Rik van Riel <riel@redhat.com> Link: http://lkml.kernel.org/r/1386833006-6600-3-git-send-email-liwanp@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ebdb08bf2ec2..37892d73f1e7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -921,7 +921,8 @@ static inline unsigned long group_faults(struct task_struct *p, int nid)
if (!p->numa_group)
return 0;
- return p->numa_group->faults[2*nid] + p->numa_group->faults[2*nid+1];
+ return p->numa_group->faults[task_faults_idx(nid, 0)] +
+ p->numa_group->faults[task_faults_idx(nid, 1)];
}
/*