public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Jan Beulich <jbeulich@novell.com>,
	linux-kernel@vger.kernel.org, ccache@lists.samba.org
Subject: Re: [REGRESSION] Recent change to kernel spikes out ccache/distcc
Date: Tue, 6 Jan 2009 23:33:29 -0500	[thread overview]
Message-ID: <20090107043329.GA13267@mit.edu> (raw)
In-Reply-To: <20090106220950.GA23838@uranus.ravnborg.org>

On Tue, Jan 06, 2009 at 11:09:50PM +0100, Sam Ravnborg wrote:
> Hi Ted.
> 
> How about this simple patch.
> 
> It basically starts all over again with the C file if the
> file did not export any symbols (typical case).

I tried the patch.  It does cause ccache to be functional again, at
least as far as causing the "cache hit" stats to get bumped.  However,
the ccache "called for link" stats is still going up (which is I guess
how ccache misleadingly categorizes "cc -S" requests to compile to
assembly).  However, it doesn't actually save time; quite the reverse,
it makes things worse.  Doing a 32-bit compile, I tried compiling a
kernel where after each compile, I remove the ext4 object files via
"/bin/rm ../ext4-32/fs/ext4/*.o".  Without the patch, these were the
results after getting the cache warm, running the compile three tims,
and taking the average:

real 36.238 // user 44.143 // sys 11.375

Applying the patch, it actually took longer to recompile fs/ext4/*.o
and relink vmlinuz: (again average of three compiles)

real 38.401 // user 46.438 // sys 11.838

That's because ccache has to do the ccache -E and then calculate the
checksum to look up the results of the cache.  Before the patch, we
are doing this:

    preprocessor, compile, check for exported sysmbols, assemble

after the patch, we are doing this:

      preprocessor, compile, check for exported symbols, then (in
      ccache), preprocessor, locate the cached object file, write
      cached objectfile.

What this experiment shows is that even with a completely warm cache,
it's faster to run the assembler than to run ccache and have it re-run
the preprocessor and look up the cached object file.  In fact, it's
quite a bit faster.

So basically, in order to make things work well with ccache, we really
need to avoid redoing the compile unconditionally.  If the goal is
just to check to see if there were any exported symbols, we would be
better off doing a grep for EXPORT_SYMBOL.

In contrast, with 2.6.28, the numbers for just compiling fs/ext4/*.o
and relinking vmlinuz is.

real 28.836 // user 30.949 // sys 10.562

Note that the bulk of this time is doing the kbuild setup and
relinking vmlinuz.  The amount of time to do setup and relink is
18.677 / 21.639 / 8.253.  So if you subtract that out, and simply
compare the time to compile fs/ext4/*.o, what you get is:

2.6.28:     	    	     real 10.159 user  9.310 sys 2.309
2.6.28-git7:	      	     real 17.561 user 22.503 sys 3.122
2.6.28-git7 w/your patch     real 19.724 user 24.799 sys 3.585


Bottom line, I suspect if we want to make builds fast, we really need
to cache the full kbuild pipeline.  I hope you find these measurements
useful.

       	     	       	       	     	 - Ted


  reply	other threads:[~2009-01-07  4:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 15:15 [REGRESSION] Recent change to kernel spikes out ccache/distcc Theodore Ts'o
2009-01-06 15:29 ` Jan Beulich
2009-01-06 17:33   ` Theodore Tso
2009-01-06 17:48     ` Sam Ravnborg
2009-01-06 18:04       ` Theodore Tso
2009-01-07  8:50     ` Jan Beulich
2009-01-07 11:31       ` Sam Ravnborg
2009-01-07 12:35         ` Jan Beulich
2009-01-07 13:23           ` Sam Ravnborg
2009-01-07 13:48             ` Jan Beulich
2009-01-07 20:06               ` Sam Ravnborg
2009-01-08 19:16                 ` Kyle McMartin
2009-01-12 14:06                 ` Gilles Espinasse
2009-01-06 17:53   ` Sam Ravnborg
2009-01-06 16:26 ` David Miller
2009-01-06 18:12   ` Theodore Tso
2009-01-06 22:09 ` Sam Ravnborg
2009-01-07  4:33   ` Theodore Tso [this message]
2009-01-07  5:10 ` Al Viro
2009-01-07  8:49   ` Jan Beulich
2009-01-07 14:03     ` Al Viro
2009-01-07 14:28       ` Jan Beulich
2009-01-07 14:37         ` Al Viro
2009-01-07 14:40           ` Jan Beulich
2009-01-07 13:12 ` Theodore Tso
2009-01-07 13:39   ` Jan Beulich
2009-01-07 14:28     ` Theodore Tso
2009-01-07 14:39       ` Jan Beulich
2009-01-08 19:17   ` Dave Jones
2009-01-08 21:31     ` Theodore Tso
2009-01-11 21:48       ` Kyle McMartin
2009-01-11 22:11         ` Theodore Tso
2009-01-11 22:51         ` Theodore Tso
2009-01-11 22:55           ` Kyle McMartin
2009-01-14 17:16 ` Peter Zijlstra
2009-01-15  9:11   ` Jan Beulich
2009-01-15 13:40     ` Theodore Tso

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=20090107043329.GA13267@mit.edu \
    --to=tytso@mit.edu \
    --cc=ccache@lists.samba.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.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