aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2013-10-07 06:28:59 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-09 06:40:25 -0400
commit745d61476ddb737aad3495fa6d9a8f8c2ee59f86 (patch)
treeae6ebeefdcee8b5615f21e2f8a960f92fbdd2f71 /include/linux/sched.h
parent688b7585d16ab57a17aa4422a3b290b3a55fa679 (diff)
sched/numa: Update NUMA hinting faults once per scan
NUMA hinting fault counts and placement decisions are both recorded in the same array which distorts the samples in an unpredictable fashion. The values linearly accumulate during the scan and then decay creating a sawtooth-like pattern in the per-node counts. It also means that placement decisions are time sensitive. At best it means that it is very difficult to state that the buffer holds a decaying average of past faulting behaviour. At worst, it can confuse the load balancer if it sees one node with an artifically high count due to very recent faulting activity and may create a bouncing effect. This patch adds a second array. numa_faults stores the historical data which is used for placement decisions. numa_faults_buffer holds the fault activity during the current scan window. When the scan completes, numa_faults decays and the values from numa_faults_buffer are copied across. Signed-off-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> 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-22-git-send-email-mgorman@suse.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b1fc75e7187b..a463bc3ad437 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1343,7 +1343,20 @@ struct task_struct {
1343 u64 node_stamp; /* migration stamp */ 1343 u64 node_stamp; /* migration stamp */
1344 struct callback_head numa_work; 1344 struct callback_head numa_work;
1345 1345
1346 /*
1347 * Exponential decaying average of faults on a per-node basis.
1348 * Scheduling placement decisions are made based on the these counts.
1349 * The values remain static for the duration of a PTE scan
1350 */
1346 unsigned long *numa_faults; 1351 unsigned long *numa_faults;
1352
1353 /*
1354 * numa_faults_buffer records faults per node during the current
1355 * scan window. When the scan completes, the counts in numa_faults
1356 * decay and these values are copied.
1357 */
1358 unsigned long *numa_faults_buffer;
1359
1347 int numa_preferred_nid; 1360 int numa_preferred_nid;
1348#endif /* CONFIG_NUMA_BALANCING */ 1361#endif /* CONFIG_NUMA_BALANCING */
1349 1362