From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx185.postini.com [74.125.245.185]) by kanga.kvack.org (Postfix) with SMTP id 0F3AB6B00AC for ; Wed, 3 Oct 2012 19:51:53 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 20/33] autonuma: default mempolicy follow AutoNUMA Date: Thu, 4 Oct 2012 01:51:02 +0200 Message-Id: <1349308275-2174-21-git-send-email-aarcange@redhat.com> In-Reply-To: <1349308275-2174-1-git-send-email-aarcange@redhat.com> References: <1349308275-2174-1-git-send-email-aarcange@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Linus Torvalds , Andrew Morton , Peter Zijlstra , Ingo Molnar , Mel Gorman , Hugh Dickins , Rik van Riel , Johannes Weiner , Hillf Danton , Andrew Jones , Dan Smith , Thomas Gleixner , Paul Turner , Christoph Lameter , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Srivatsa Vaddagiri , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt If an task_selected_nid has already been selected for the task, try to allocate memory from it even if it's temporarily not the local node. Chances are it's where most of its memory is already located and where it will run in the future. Acked-by: Rik van Riel Signed-off-by: Andrea Arcangeli --- mm/mempolicy.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4ada3be..5cffcb6 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1951,10 +1951,18 @@ retry_cpuset: */ if (pol->mode == MPOL_INTERLEAVE) page = alloc_page_interleave(gfp, order, interleave_nodes(pol)); - else + else { + int nid = -1; +#ifdef CONFIG_AUTONUMA + if (current->task_autonuma) + nid = current->task_autonuma->task_selected_nid; +#endif + if (nid < 0) + nid = numa_node_id(); page = __alloc_pages_nodemask(gfp, order, - policy_zonelist(gfp, pol, numa_node_id()), + policy_zonelist(gfp, pol, nid), policy_nodemask(gfp, pol)); + } if (unlikely(!put_mems_allowed(cpuset_mems_cookie) && !page)) goto retry_cpuset; -- 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