Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755424Ab2F1M5x (ORCPT ); Thu, 28 Jun 2012 08:57:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63427 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755357Ab2F1M5t (ORCPT ); Thu, 28 Jun 2012 08:57:49 -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 17/40] autonuma: autonuma_enter/exit Date: Thu, 28 Jun 2012 14:55:57 +0200 Message-Id: <1340888180-15355-18-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: 1688 Lines: 49 The first gear in the whole AutoNUMA algorithm is knuma_scand. If knuma_scand doesn't run AutoNUMA is a full bypass. If knuma_scand is stopped, soon all other AutoNUMA gears will settle down too. knuma_scand is the daemon that sets the pmd_numa and pte_numa and allows the NUMA hinting page faults to start and then all other actions follows as a reaction to that. knuma_scand scans a list of "mm" and this is where we register and unregister the "mm" into AutoNUMA for knuma_scand to scan them. Signed-off-by: Andrea Arcangeli --- kernel/fork.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 5fcfa70..d3c064c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -540,6 +541,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p) if (likely(!mm_alloc_pgd(mm))) { mm->def_flags = 0; mmu_notifier_mm_init(mm); + autonuma_enter(mm); return mm; } @@ -608,6 +610,7 @@ void mmput(struct mm_struct *mm) exit_aio(mm); ksm_exit(mm); khugepaged_exit(mm); /* must run before exit_mmap */ + autonuma_exit(mm); /* must run before exit_mmap */ exit_mmap(mm); set_mm_exe_file(mm, NULL); if (!list_empty(&mm->mmlist)) { -- 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/