git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Kjetil Barvik <barvik@broadpark.no>
Cc: Bevan Watkiss <bevan.watkiss@cloakware.com>,
	"'Alex Riesen'" <raa.lkml@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: 'git checkout' and unlink() calls (was: Re: )
Date: Fri, 8 May 2009 10:57:32 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0905081050420.4983@localhost.localdomain> (raw)
In-Reply-To: <86y6t77d8t.fsf_-_@broadpark.no>



On Fri, 8 May 2009, Kjetil Barvik wrote:
> 
>   So, if the numbers from strace is trustable, 0.71 seconds is used on
>   41 114 calls to lstat64().  But, look at the unlink line, where each
>   call took 259 microseconds (= 0.259 milliseconds), and all 14 379
>   calls took 3.72 seconds.

The system call times from strace are not really trustworthy. The overhead 
of tracing and in particular all the context switching back and forth 
between the tracer and the tracee means that the numbers should be taken 
with a large grain of salt. 

That said, they definitely aren't totally made up, and they tend to show 
real issues.

In this particular case, what is going on is that 'lstat()' does no IO at 
all, while 'unlink()' generally at the very least will add things to some 
journal etc, and when the journal fills up, it will force IO.

So doing 15k unlink() calls really is _much_ more expensive than doing 41k 
lstat() calls, since the latter will never force any IO at all (ok, so 
even doing just an lstat() may add atime updates etc to directories, but 
even if atime is enabled, that tends to only trigger one IO per second at 
most, and we never have to do any sync IO).

>   It should be noted that when switching branch the other way (from .25
>   to .27), the unlink() calls used less time (below 160 microseconds
>   each).

I don't think they are really "260 us each" or "160 us each". It's rather 
more likely that there are a few that are big due to forced IO, and most 
are in the couple of us case.

		Linus

      reply	other threads:[~2009-05-08 18:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07 17:01 (unknown), Bevan Watkiss
2009-05-07 17:13 ` Alex Riesen
2009-05-07 17:26   ` Bevan Watkiss
2009-05-07 18:18     ` Alex Riesen
2009-05-07 18:48       ` Bevan Watkiss
2009-05-07 19:56         ` Björn Steinbrink
2009-05-07 18:56     ` Linus Torvalds
2009-05-07 19:37       ` RE: Bevan Watkiss
2009-05-07 20:07         ` RE: Linus Torvalds
2009-05-07 20:20           ` RE: Linus Torvalds
2009-05-07 20:43             ` Junio C Hamano
2009-05-07 21:33               ` Re: Linus Torvalds
2009-05-07 21:55             ` Linus Torvalds
2009-05-07 22:27               ` RE: david
2009-05-07 22:36                 ` RE: Linus Torvalds
2009-05-07 22:43                   ` RE: david
2009-05-07 23:00                     ` RE: Linus Torvalds
2009-05-07 23:07                       ` RE: david
2009-05-07 23:18                         ` RE: Linus Torvalds
2009-05-07 23:31                           ` RE: david
2009-05-07 23:57                             ` Johan Herland
2009-05-08 16:14                             ` Bevan Watkiss
2009-05-08  8:17               ` Alex Riesen
2009-05-08 14:39                 ` Re: Linus Torvalds
2009-05-08 15:51                   ` Re: Brandon Casey
2009-05-08 16:15                     ` Re: Linus Torvalds
2009-05-08 17:27                       ` Re: Brandon Casey
2009-05-08 17:43                         ` Re: Brandon Casey
2009-05-08 21:49                           ` Re: Linus Torvalds
2009-05-08 23:04                             ` Re: Brandon Casey
2009-05-09 16:44                               ` Re: Linus Torvalds
2009-05-08 17:44                         ` Re: Linus Torvalds
2009-05-08 16:47               ` 'git checkout' and unlink() calls (was: Re: ) Kjetil Barvik
2009-05-08 17:57                 ` Linus Torvalds [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0905081050420.4983@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=barvik@broadpark.no \
    --cc=bevan.watkiss@cloakware.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).