From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx163.postini.com [74.125.245.163]) by kanga.kvack.org (Postfix) with SMTP id D14E48D001B for ; Thu, 22 Nov 2012 17:51:54 -0500 (EST) Received: by mail-ea0-f169.google.com with SMTP id a12so3216535eaa.14 for ; Thu, 22 Nov 2012 14:51:54 -0800 (PST) From: Ingo Molnar Subject: [PATCH 32/33] sched: Add hysteresis to p->numa_shared Date: Thu, 22 Nov 2012 23:49:53 +0100 Message-Id: <1353624594-1118-33-git-send-email-mingo@kernel.org> In-Reply-To: <1353624594-1118-1-git-send-email-mingo@kernel.org> References: <1353624594-1118-1-git-send-email-mingo@kernel.org> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Peter Zijlstra , Paul Turner , Lee Schermerhorn , Christoph Lameter , Rik van Riel , Mel Gorman , Andrew Morton , Andrea Arcangeli , Linus Torvalds , Thomas Gleixner , Johannes Weiner , Hugh Dickins 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 Cc: Linus Torvalds Cc: Andrew Morton Cc: Peter Zijlstra Cc: Andrea Arcangeli Cc: Rik van Riel Cc: Mel Gorman Cc: Hugh Dickins Signed-off-by: Ingo Molnar --- 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org