From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx134.postini.com [74.125.245.134]) by kanga.kvack.org (Postfix) with SMTP id 8A7496B00EA for ; Fri, 25 May 2012 13:03:11 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 16/35] autonuma: autonuma_enter/exit Date: Fri, 25 May 2012 19:02:20 +0200 Message-Id: <1337965359-29725-17-git-send-email-aarcange@redhat.com> In-Reply-To: <1337965359-29725-1-git-send-email-aarcange@redhat.com> References: <1337965359-29725-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: 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 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 98db8b0..237c34e 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -539,6 +540,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; } @@ -607,6 +609,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, 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org