lkml.org 
[lkml]   [2012]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 32/33] sched: Add hysteresis to p->numa_shared
Date
Make p->numa_shared flip/flop less around unstable equilibriums,
instead require a significant move in either direction to trigger
'dominantly shared accesses' versus 'dominantly private accesses'
NUMA status.

Suggested-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8aa4b36..ab4a7130 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1111,7 +1111,20 @@ static void task_numa_placement(struct task_struct *p)
* we might want to consider a different equation below to reduce
* the impact of a little private memory accesses.
*/
- shared = (total[0] >= total[1] / 2);
+ shared = p->numa_shared;
+
+ if (shared < 0) {
+ shared = (total[0] >= total[1]);
+ } else if (shared == 0) {
+ /* If it was private before, make it harder to become shared: */
+ if (total[0] >= total[1]*2)
+ shared = 1;
+ } else if (shared == 1 ) {
+ /* If it was shared before, make it harder to become private: */
+ if (total[0]*2 <= total[1])
+ shared = 0;
+ }
+
if (shared)
p->ideal_cpu = sched_update_ideal_cpu_shared(p);
else
--
1.7.11.7


\
 
 \ /
  Last update: 2012-11-23 03:01    [W:0.264 / U:1.004 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site