mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Subject: Re: kbuild 2.5 is ready for inclusion in the 2.5 kernel
Date: Sat, 04 May 2002 19:03:02 +1000	[thread overview]
Message-ID: <23023.1020502982@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Sat, 04 May 2002 16:44:08 +1000." <15571.33592.365558.215598@argo.ozlabs.ibm.com>

On Sat, 4 May 2002 16:44:08 +1000 (EST), 
Paul Mackerras <paulus@samba.org> wrote:
>Keith Owens writes:
>> be reused is horribly error prone.  And it would take just as long as
>> rebuilding the global makefile from scratch.
>
>I seriously doubt that last statement.  Building the global makefile
>takes about 20 seconds on the box I compile on.  On a kernel tree
>without object files I can read all the files in the kernel tree in
>about 0.8 seconds, and I can calculate an md5sum of every file in 3.2
>seconds.  I can do an md5sum of all the Makefile.in's in 0.1 seconds.
>This is with pp_makefile* compiled with -O2 -DNDEBUG=1.

Those times do not look right, the build times look too long.  On a
Pentium III 700MHz with 1GiB ram, I get

# cd $KBUILD_SRCTREE_000
# time md5sum -c ../sums > /dev/null
7.10user 0.73system 0:07.82elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
# time make -f $KBUILD_SRCTREE_000/Makefile-2.5 phase4
Using ARCH='i386' AS='as' LD='ld' CC='/usr/bin/kgcc' CPP='/usr/bin/kgcc -E' AR='ar' HOSTAS='as' HOSTLD='gcc' HOSTCC='gcc' HOSTAR='ar'
Generating global Makefile
  phase 1 (find all inputs)
4.31user 0.15system 0:04.45elapsed 100%CPU (0text+0data 0max)k
  phase 2 (convert all Makefile.in files)
1.66user 0.03system 0:01.69elapsed 99%CPU (0text+0data 0max)k
  phase 3 (evaluate selections)
1.10user 0.91system 0:01.91elapsed 104%CPU (0text+0data 0max)k
  phase 4 (integrity checks, write global makefile)
10.02user 0.08system 0:10.10elapsed 99%CPU (0text+0data 0max)k
17.40user 1.40system 0:18.59elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k

Doing all the setup work on this machine takes ~2.5 times as long as
md5sum, but it does more work than just md5sum.  phase4 also does all
the integrity checks, cleans up dead files, checks for timestamp skew,
runs the config dependency chains etc.

What would it require to optimize for the "no config/makefile change"?

md5sums alone are not enough, people touch source or header files, even
config options and expect objects to be rebuilt, timestamps are
required as well.  A change to the KBUILD_SRCTREE_nnn environment
variables adds or deletes entire trees.  So phase1 is still required,
to find all the files in all the trees and get their current
timestamps.  "Optimizing" will not save any time there, kbuild always
needs current timestamp data.

That gives 7.8 seconds to check the md5sums compared to 14.2 seconds to

* convert the Makefile.in files (using the latest values for the kbuild
  variables from the environment and the command line)
* evaluate the selections (which can be overridden on the command line)
* run the config dependency chains
* do all the integrity checks
* handle special cases like asking for a .i or .s file on the command
  line
* write the global makefile.

Not a huge difference, especially considering it is doing more than a
simple checksum.

It is the config dependency, integrity checks and special case
processing that take the bulk of phase4, writing the makefile is a
small percentage.  "Optimizing" could only save a small amount of time
and would require extra code and time to work out if I could save any
time.

When I build the pp_ programs with -O2 -NDEBUG=1, the times go down to

  phase 1 (find all inputs)
2.78user 0.11system 0:02.88elapsed 100%CPU (0text+0data 0max)k
  phase 2 (convert all Makefile.in files)
1.09user 0.02system 0:01.10elapsed 100%CPU (0text+0data 0max)k
  phase 3 (evaluate selections)
1.04user 0.97system 0:01.89elapsed 106%CPU (0text+0data 0max)k
  phase 4 (integrity checks, write global makefile)
6.10user 0.10system 0:06.19elapsed 100%CPU (0text+0data 0max)k
11.35user 1.38system 0:12.53elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k

Not bad for something that is doing a lot more work than a simple
checksum, 1.6 times as long as md5sum for complete kbuild support.  As
it stands kbuild 2.5 provides additional features, is far more accurate
and is 30% faster than kbuild 2.4.  I even provide an option for
bypassing everything and going straight to the build step, that option
is also faster and more accurate than the kbuild 2.4 equivalent.

If all of that is not enough justification for replacing the old
system, then shaving a few seconds off the startup code is not going to
make any difference.


  parent reply	other threads:[~2002-05-04  9:03 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-01 14:23 Keith Owens
2002-05-02 15:17 ` Denis Vlasenko
2002-05-02 10:38   ` tomas szepe
2002-05-02 12:21     ` Keith Owens
2002-05-02 12:49       ` Martin Dalecki
2002-05-02 14:26         ` Alan Cox
2002-05-02 13:32           ` Martin Dalecki
2002-05-02 14:54             ` Kai Germaschewski
2002-05-02 15:17             ` Alan Cox
2002-05-05  9:43               ` Mike Fedyk
2002-05-05 10:16                 ` Keith Owens
2002-05-02 15:21             ` Arjan van de Ven
2002-05-02 15:59               ` Richard Gooch
2002-05-02 15:36                 ` Martin Dalecki
2002-05-02 17:15                   ` Alan Cox
2002-05-02 16:30                     ` Martin Dalecki
2002-05-02 18:20                       ` Alan Cox
2002-05-02 17:25                   ` Arjan van de Ven
2002-05-02 16:53                     ` Martin Dalecki
2002-05-02 17:48                       ` David S. Miller
2002-05-02 17:42                         ` Martin Dalecki
2002-05-02 19:11                           ` Alan Cox
2002-05-02 18:22                             ` Martin Dalecki
2002-05-02 18:49                             ` David S. Miller
2002-05-02 18:33                       ` Alan Cox
2002-05-02 14:24       ` Kai Germaschewski
2002-05-02 15:18         ` David Woodhouse
2002-05-02 15:40           ` Kai Germaschewski
2002-05-02 23:40             ` Keith Owens
2002-05-02 23:25               ` Martin Dalecki
2002-05-03 14:48               ` Kai Germaschewski
2002-05-03 15:45                 ` Keith Owens
2002-05-02 15:19         ` Alan Cox
2002-05-02 22:57           ` Pavel Machek
2002-05-03  8:33             ` Vikram
2002-05-03 12:07               ` Keith Owens
2002-05-18  1:14                 ` Andrea Arcangeli
2002-05-18  1:33                   ` Dave Jones
2002-05-18  3:06                     ` Oliver Xymoron
2002-05-18 12:28                     ` [PATCH] move jiffies from sched.h to it's own jiffies.h Tim Schmielau
2002-05-19 22:33                       ` Tim Schmielau
2002-05-20  2:32                       ` Rusty Russell
2002-05-18  2:12                   ` kbuild 2.5 is ready for inclusion in the 2.5 kernel Gerhard Mack
2002-05-18  2:13                   ` Keith Owens
2002-05-18  2:30                     ` Andrea Arcangeli
2002-05-20  2:38                     ` Miles Bader
2002-05-02 21:34       ` tomas szepe
2002-05-02 21:42         ` Dave Jones
2002-05-03  1:19           ` John Covici
2002-05-03  1:33             ` Keith Owens
2002-05-03  1:39               ` tomas szepe
2002-05-03  2:31             ` Alexander Viro
2002-05-03  3:21               ` Davide Libenzi
2002-05-02 21:42         ` Alexander Viro
2002-05-02 23:25           ` tomas szepe
2002-05-03 21:05           ` Mark H. Wood
2002-05-04 13:58             ` Kurt Wall
2002-05-06  1:54             ` Mike Fedyk
2002-05-02 22:54 ` Pavel Machek
2002-05-03  9:00   ` Keith Owens
2002-05-03  4:17 ` Randy.Dunlap
2002-05-03  5:02   ` Keith Owens
2002-05-03  6:32     ` Randy.Dunlap
2002-05-03 10:06     ` Gerd Knorr
2002-05-03 10:42       ` Keith Owens
2002-05-03 12:05         ` Gerd Knorr
2002-05-03 13:31           ` Keith Owens
2002-05-04  6:44         ` Paul Mackerras
2002-05-04  8:03           ` Paul Mackerras
2002-05-06  0:42             ` Mike Fedyk
2002-05-06  4:07               ` Paul Mackerras
2002-05-04  9:03           ` Keith Owens [this message]
2002-05-04  9:38             ` Russell King
2002-05-04 10:33             ` Paul Mackerras
2002-05-04 11:49               ` Keith Owens
2002-05-06  8:40                 ` Gerd Knorr
2002-05-07  4:14                   ` Keith Owens
2002-05-04 15:30               ` Richard Gooch
2002-05-05 17:23 ` Urban Widmark
2002-05-05 23:36   ` Keith Owens
2002-05-06 11:33     ` Urban Widmark
2002-05-06 23:54       ` Keith Owens
2002-05-06 10:54 ` Alex Riesen
2002-05-08  2:54   ` Keith Owens
2002-05-08 17:25     ` Alex Riesen
2002-05-09  0:10       ` Keith Owens
2002-05-09  0:55         ` Daniel Jacobowitz
2002-05-09  1:44           ` Keith Owens
2002-05-05 16:42 Dan Kegel
2002-05-05 23:44 ` Keith Owens
2002-05-06  0:02   ` Dan Kegel
2002-05-06  0:40     ` Keith Owens
2002-05-06 15:38 ` Alan Cox
2002-05-06 15:33   ` Tomas Szepe
     [not found] <cs.lists.linux-kernel/18740.1020729269@ocs3.intra.ocs.com.au>
2002-05-07 23:48 ` Ion Badulescu
2002-05-08  0:10   ` Keith Owens
2002-05-08  0:37     ` Alan Cox
2002-05-08  0:34       ` Keith Owens

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=23023.1020502982@ocs3.intra.ocs.com.au \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®