lkml.org 
[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: process creation time increases linearly with shmem
Andi Kleen wrote:
>>Would it be worth trying to do something like this?
>
>
> Maybe. Shouldn't be very hard though - you just need to check if the VMA is
> backed by an object and if yes don't call copy_page_range for it.
>
> I think it just needs (untested)
>

I think you need to check for MAP_SHARED as well, because
MAP_PRIVATE mapping of a file could be modified in parent.

See patch I posted just now.

Also, do you need any special case for hugetlb?


> Index: linux-2.6.13-rc5-misc/kernel/fork.c
> ===================================================================
> --- linux-2.6.13-rc5-misc.orig/kernel/fork.c
> +++ linux-2.6.13-rc5-misc/kernel/fork.c
> @@ -265,7 +265,8 @@ static inline int dup_mmap(struct mm_str
> rb_parent = &tmp->vm_rb;
>
> mm->map_count++;
> - retval = copy_page_range(mm, current->mm, tmp);
> + if (!file && !is_vm_hugetlb_page(vma))
> + retval = copy_page_range(mm, current->mm, tmp);
> spin_unlock(&mm->page_table_lock);
>
> if (tmp->vm_ops && tmp->vm_ops->open)
>
> But I'm not sure it's a good idea in all cases. Would need a lot of
> benchmarking at least.
>

Yep. I'm sure it must have come up in the past, and Linus
must have said something about best-for-most.

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com

-
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/

\
 
 \ /
  Last update: 2005-08-25 17:02    [W:0.064 / U:1.904 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site