public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Allow for parallel builds and saved output
Date: Wed, 25 Apr 2012 10:22:09 +0200	[thread overview]
Message-ID: <4F97B431.2070207@aribaud.net> (raw)
In-Reply-To: <1335332031-24138-1-git-send-email-afleming@freescale.com>

Hi Andy,

Le 25/04/2012 07:33, Andy Fleming a ?crit :
> The MAKEALL script cleverly runs make with the appropriate options
> to use all of the cores on the system, but your average U-Boot build
> can't make much use of more than a few cores.  If you happen to have
> a many-core server, your builds will leave most of the system idle.
>
> In order to make full use of such a system, we need to build multiple
> targets in parallel, and this requires directing make output into
> multiple directories. We add a BUILD_NBUILDS variable, which allows
> users to specify how many builds to run in parallel.
> When BUILD_NBUILDS is set greater than 1, we redefine BUILD_DIR for
> each build to be ${BUILD_DIR}/${target}. Also, we make "./build" the
> default BUILD_DIR when BUILD_NBUILDS is greater than 1.
>
> MAKEALL now tracks which builds are still running, and when one
> finishes, it starts a new build.
>
> Once each build finishes, we run "make tidy" on its directory, to reduce
> the footprint.
>
> As a result, we are left with a build directory with all of the built
> targets still there for use, which means anyone who wanted to use
> MAKEALL as part of a test harness can now do so.
>
> Signed-off-by: Andy Fleming<afleming@freescale.com>
> ---
> v2:	- Update to keep BUILD_NBUILDS builds in flight, rather than batching
> 	- Clean up style things
> 	- Defer error output until build completion to make output *slightly*
> 	more readable
>
> v3:	- Add BUILD_MANY variable to clarify logic
> 	- Added comment for done/skip prefixes, and renamed for clarity
> 	- Changed CURRENT_COUNT to CURRENT_CNT to match TOTAL_CNT
> 	- Put build wait logic into its own manage_build function
> 	- Used wildcards to delete build management files
> 	- Fixed a bug where error-less builds printed an error

For ./MAKEALL arm, using cs2011-09, 7 builds 1 cpu on a 8 thread machine:

real	29m20.272s
user	95m59.708s
sys	10m17.383s

without the patch, and

real	20m26.480s
user	100m1.155s
sys	8m34.988s

with it, so there is definitely a benefit.

*However*, two boards build without and do not build clean with: scpu 
and pndb3.

Also, the final report is not displayed as the same with and without the 
patch -- with it, unclean boards are listed one per line, without it, 
they are listed in a single line.

Last: breaking during a parallel build then trying a git clean -xfd 
causes errors such as files missing.

Amicalement,
-- 
Albert.

  reply	other threads:[~2012-04-25  8:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  5:33 [U-Boot] [PATCH v3] Allow for parallel builds and saved output Andy Fleming
2012-04-25  8:22 ` Albert ARIBAUD [this message]
2012-04-25 22:07   ` Andy Fleming
2012-04-30 14:53 ` Wolfgang Denk
2012-05-06  1:48   ` Marek Vasut
2012-05-08 19:17     ` Albert ARIBAUD
2012-05-08 19:19       ` Andy Fleming
2012-05-08 19:50         ` Marek Vasut
2012-05-08 19:55           ` Andy Fleming
2012-05-18 11:47           ` Wolfgang Denk

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=4F97B431.2070207@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /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