git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Why so much time in the kernel?
Date: Fri, 16 Jun 2006 08:06:58 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606160755170.5498@g5.osdl.org> (raw)
In-Reply-To: <9e4733910606160749t4d7a541ev72a67383e96d86da@mail.gmail.com>



On Fri, 16 Jun 2006, Jon Smirl wrote:
> 
> I am spending over 40% of the time in the kernel. This looks to be
> caused from forks and starting small tasks, is that the correct
> interpretation?

Yes. Your kernel profile is all for stuff related to setting up and 
tearing down process space (well, __mutex_lock_slowpath at 1.88% and 
__d_lookup at 1.3% is not, but every single one before that does seem to 
be about fork/exec/exit).

I think it's both the CVS server that continually forks/exits (it doesn't 
actually do a exec at all - it seem sto be using fork/exit as a way to 
control its memory usage - knowing that the OS will free all the temporary 
memory on exit - I think the newer CVS development trees don't do this, 
but that also seems to be why they leak memory like mad and eventually run 
out ;).

AND it's git-cvsimport forking and exec'ing git helper processes. 

So that process overhead is expected.

What I would _not_ have expected is:

>   933646  2.0983 /usr/local/bin/git-read-tree

I don't see why git-read-tree is so hot for you. We should never need to 
read a tree when we're importing something, unless there are tons of 
branches and we switch back and forth between them.

I guess mozilla really does use a fair number of branches? 

Martin sent out a patch (that I don't think has been merged yet) to avoid 
the git-read-tree overhead when switching branches. Look for an email with 
a subject like "cvsimport: keep one index per branch during import", I 
suspect that would speed up the git part a lot.

(It will also avoid a few fork/exec's, but you'll still have most of them, 
so I don't think you'll see any really _fundamental_ changes to this, but 
the git-read-tree overhead should be basically gone, and some of the 
libz.so pressure would also be gone with it. It should also avoid 
rewriting the index file, so you'd get lower disk pressure, but it looks 
like none of your problems are really due to IO, so again, that probably 
won't make much of a difference for you).

			Linus

  reply	other threads:[~2006-06-16 15:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-16 14:49 Why so much time in the kernel? Jon Smirl
2006-06-16 15:06 ` Linus Torvalds [this message]
2006-06-16 15:25   ` Jon Smirl
2006-06-16 16:09     ` Linus Torvalds
2006-06-16 17:00       ` Jon Smirl
2006-06-16 17:09         ` Jakub Narebski
2006-06-16 17:29         ` Keith Packard
2006-06-16 17:44           ` Jon Smirl
2006-06-16 18:02             ` Keith Packard
2006-06-16 18:07             ` Nicolas Pitre
2006-06-16 18:32         ` Linus Torvalds

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=Pine.LNX.4.64.0606160755170.5498@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=jonsmirl@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).