> + if ((mm = kmem_cache_alloc(mm_cachep, SLAB_KERNEL)) == NULL)
> + goto close_fail;
> + memcpy(mm, current->mm, sizeof(*mm));
> + if (!mm_init(mm)) {
> + kmem_cache_free(mm_cachep, mm);
> + goto close_fail;
> + }
> + down(¤t->mm->mmap_sem);
Umm not quite what I meant. Take a look at copy_mm in fork.c
The code starting
m = allocate_mm()
down to just before
/*
* child gets a
Does the real thing you need to do to be sure the mm is properly set up.
You can also drop the original mm and make that current->mm to avoid the
passing of mm around. In fact you probably should do that.
-
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/