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<aflem...@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.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to