[U-Boot] [PATCH v3] Allow for parallel builds and saved output

Wolfgang Denk wd at denx.de
Mon Apr 30 16:53:14 CEST 2012


Dear Andy Fleming,

In message <1335332031-24138-1-git-send-email-afleming at freescale.com> you wrote:
> 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 at 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
> 
> Once again, my unscientific tests on my 24-thread box:
> 
> time ./MAKEALL 83xx
> real    4m2.951s
> user    26m6.534s
> sys     4m0.070s
> 
> time ./MAKEALL 86xx
> real    0m27.271s
> user    3m10.706s
> sys     0m27.123s
> 
> time BUILD_NBUILDS=50 BUILD_NCPUS=1 ./MAKEALL 86xx
> 
> real    0m38.430s
> user    2m11.601s
> sys     0m18.610s
> 
> time BUILD_NBUILDS=50 BUILD_NCPUS=1 ./MAKEALL 83xx
> 
> real    1m15.642s
> user    15m2.125s
> sys     2m25.818s
> 
> time BUILD_NBUILDS=50 BUILD_NCPUS=1 ./MAKEALL 85xx
> 
> real    4m29.840s
> user    80m30.641s
> sys     10m49.643s
> 
> 
> Looks like 86xx was affected by having only 5 boards:
> 
> time BUILD_NBUILDS=10 BUILD_NCPUS=4 ./MAKEALL 86xx
> real    0m11.887s
> user    2m22.299s
> sys     0m20.894s
> 
> 
>  MAKEALL |  137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
>  1 files changed, 122 insertions(+), 15 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
We Klingons believe as you do -- the sick should die. Only the strong
should live.
	-- Kras, "Friday's Child", stardate 3497.2


More information about the U-Boot mailing list