lkml.org 
[lkml]   [2012]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 20/40] autonuma: alloc/free/init mm_autonuma
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


\
 
 \ /
  Last update: 2012-07-01 18:21    [W:1.537 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site