From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx115.postini.com [74.125.245.115]) by kanga.kvack.org (Postfix) with SMTP id 416306B00C9 for ; Sun, 1 Jul 2012 11:33:59 -0400 (EDT) Message-ID: <4FF06DBD.6020901@redhat.com> Date: Sun, 01 Jul 2012 11:33:17 -0400 From: Rik van Riel MIME-Version: 1.0 Subject: Re: [PATCH 20/40] autonuma: alloc/free/init mm_autonuma References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> <1340888180-15355-21-git-send-email-aarcange@redhat.com> In-Reply-To: <1340888180-15355-21-git-send-email-aarcange@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, 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 , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt On 06/28/2012 08:56 AM, Andrea Arcangeli wrote: > diff --git a/kernel/fork.c b/kernel/fork.c > index 0adbe09..3e5a0d9 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -527,6 +527,8 @@ static void mm_init_aio(struct mm_struct *mm) > > static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p) > { > + if (unlikely(alloc_mm_autonuma(mm))) > + goto out_free_mm; > atomic_set(&mm->mm_users, 1); > atomic_set(&mm->mm_count, 1); > init_rwsem(&mm->mmap_sem); I wonder if it would be possible to defer the allocation of the mm_autonuma struct to knuma_scand, so short lived processes never have to allocate and free the mm_autonuma structure. That way we only have a function call at exit time, and the branch inside kfree that checks for a null pointer. -- All rights reversed -- 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