Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753834Ab2F1NG3 (ORCPT ); Thu, 28 Jun 2012 09:06:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59797 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754949Ab2F1M5l (ORCPT ); Thu, 28 Jun 2012 08:57:41 -0400 From: Andrea Arcangeli To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt Subject: [PATCH 26/40] autonuma: default mempolicy follow AutoNUMA Date: Thu, 28 Jun 2012 14:56:06 +0200 Message-Id: <1340888180-15355-27-git-send-email-aarcange@redhat.com> In-Reply-To: <1340888180-15355-1-git-send-email-aarcange@redhat.com> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1371 Lines: 43 If the task has already been moved to an autonuma_node 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. Signed-off-by: Andrea Arcangeli --- mm/mempolicy.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 1d771e4..86c0df0 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1945,10 +1945,21 @@ retry_cpuset: */ if (pol->mode == MPOL_INTERLEAVE) page = alloc_page_interleave(gfp, order, interleave_nodes(pol)); - else + else { + int nid; +#ifdef CONFIG_AUTONUMA + nid = -1; + if (current->task_autonuma) + nid = current->task_autonuma->autonuma_node; + if (nid < 0) + nid = numa_node_id(); +#else + nid = numa_node_id(); +#endif 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/