public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Rik van Riel <riel@redhat.com>, Hugh Dickins <hugh@veritas.com>,
	Ray Fucillo <fucillo@intersystems.com>,
	linux-kernel@vger.kernel.org
Subject: Re: process creation time increases linearly with shmem
Date: Sun, 28 Aug 2005 01:05:26 +1000	[thread overview]
Message-ID: <43108136.1000102@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.58.0508261621410.3317@g5.osdl.org>

Linus Torvalds wrote:
> 
> On Fri, 26 Aug 2005, Rik van Riel wrote:
> 
>>On Fri, 26 Aug 2005, Hugh Dickins wrote:
>>
>>
>>>Well, I still don't think we need to test vm_file.  We can add an
>>>anon_vma test if you like, if we really want to minimize the fork
>>>overhead, in favour of later faults.  Do we?
>>
>>When you consider NUMA placement (the child process may
>>end up running elsewhere), allocating things like page
>>tables lazily may well end up being a performance win.
> 
> 
> It should be easy enough to benchmark something like kernel compiles etc, 
> which are reasonably fork-rich and should show a good mix for something 
> like this. Or even just something like "time to restart a X session" after 
> you've brought it into memory once.
> 

2.6.13-rc7-git2
kbuild (make -j4) on  dual G5.

plain
228.85user 19.90system 2:06.50elapsed 196%CPU (3725666minor)
228.91user 19.90system 2:06.07elapsed 197%CPU (3721353minor)
229.00user 19.78system 2:06.20elapsed 197%CPU (3721345minor)
228.81user 19.94system 2:06.05elapsed 197%CPU (3723791minor)

nocopy shared
229.28user 19.76system 2:06.24elapsed 197%CPU (3725661minor)
229.04user 19.91system 2:06.92elapsed 196%CPU (3718904minor)
228.97user 20.06system 2:06.46elapsed 196%CPU (3723807minor)
229.24user 19.84system 2:06.13elapsed 197%CPU (3723793minor)

nocopy all
228.74user 19.87system 2:06.27elapsed 196%CPU (3819927minor)
228.89user 19.81system 2:05.89elapsed 197%CPU (3822943minor)
228.77user 19.73system 2:06.23elapsed 196%CPU (3820517minor)
228.93user 19.70system 2:05.84elapsed 197%CPU (3822935minor)

I'd say the full test (including anon_vma) is maybe slightly
faster on this test though maybe it isn't significant.

It is doing around 2.5% more minor faults, thought the profiles
say copy_page_range time is reduced as one would expect.

I think that if all else (ie. final performance) is equal, then
faulting is better than copying because the work is being
deferred until it is needed, and we dodge some pathological
cases like Ray's database taking 100s of ms to fork (we hope!)

However it will always depend on workload.

This is the condition I ended up with. Any good?

   if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_RESERVED))) {
     if (vma->vm_flags & VM_MAYSHARE)
       return 0;
     if (vma->vm_file && !vma->anon_vma)
       return 0;
   }

-- 
SUSE Labs, Novell Inc.

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

  reply	other threads:[~2005-08-27 15:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 18:43 process creation time increases linearly with shmem Ray Fucillo
2005-08-25  0:14 ` Nick Piggin
2005-08-25 13:07   ` Ray Fucillo
2005-08-25 13:13     ` Andi Kleen
2005-08-25 14:28     ` Nick Piggin
2005-08-25 17:31   ` Rik van Riel
2005-08-26  1:26     ` Nick Piggin
2005-08-26  1:50       ` Rik van Riel
2005-08-26  3:56       ` Linus Torvalds
2005-08-26 11:49         ` Hugh Dickins
2005-08-26 14:26           ` Nick Piggin
2005-08-26 17:00             ` Ray Fucillo
2005-08-26 17:53               ` Rik van Riel
2005-08-26 18:20                 ` Ross Biro
2005-08-26 18:56                   ` Hugh Dickins
     [not found]           ` <8783be660508260915524e2b1e@mail.gmail.com>
2005-08-26 16:38             ` Hugh Dickins
2005-08-26 16:43               ` Ross Biro
2005-08-26 18:07           ` Linus Torvalds
2005-08-26 18:41             ` Hugh Dickins
2005-08-26 22:55               ` Linus Torvalds
2005-08-26 23:10               ` Rik van Riel
2005-08-26 23:23                 ` Linus Torvalds
2005-08-27 15:05                   ` Nick Piggin [this message]
2005-08-28  4:26                     ` Hugh Dickins
2005-08-28  6:49                       ` Nick Piggin
2005-08-29 23:33                         ` Ray Fucillo
2005-08-30  0:29                           ` Nick Piggin
2005-08-30  1:03                             ` Linus Torvalds
2005-08-30  0:34                           ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2005-08-25 14:05 Parag Warudkar
2005-08-25 14:22 ` Andi Kleen
2005-08-25 14:35   ` Nick Piggin
2005-08-25 14:47   ` Parag Warudkar
2005-08-25 15:56     ` Andi Kleen
2005-12-14 14:07 Brice Oliver
2005-12-14 16:21 ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43108136.1000102@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=fucillo@intersystems.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox