From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx142.postini.com [74.125.245.142]) by kanga.kvack.org (Postfix) with SMTP id F0B2C6B00A1 for ; Wed, 3 Oct 2012 19:51:46 -0400 (EDT) From: Andrea Arcangeli Subject: [PATCH 13/33] autonuma: autonuma_enter/exit Date: Thu, 4 Oct 2012 01:50:55 +0200 Message-Id: <1349308275-2174-14-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 This is where we register (and unregister) an "mm" structure into AutoNUMA for knuma_scand to scan them. knuma_scand is the first gear in the whole AutoNUMA algorithm. knuma_scand is the daemon that scans the "mm" structures in the list and sets pmd_numa and pte_numa to allow the NUMA hinting page faults to start. All other actions follow after that. If knuma_scand doesn't run, AutoNUMA is fully bypassed. If knuma_scand is stopped, soon all other AutoNUMA gears will settle down too. Acked-by: Rik van Riel 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 ec0495b..14d68d3 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -541,6 +542,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; } @@ -609,6 +611,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/ . Don't email: email@kvack.org