svn commit: r253002 - head

Garance A Drosehn gad at
Tue Jul 9 01:07:07 UTC 2013

On 7/7/13 4:39 PM, Alfred Perlstein wrote:
> Log:
>    Document tip on how to build all kernels quickly.
> Modified: head/Makefile
> ==============================================================================
> --- head/Makefile	Sun Jul  7 19:58:14 2013	(r253001)
> +++ head/Makefile	Sun Jul  7 20:39:11 2013	(r253002)
> @@ -32,6 +32,12 @@
>   # targets             - Print a list of supported TARGET/TARGET_ARCH pairs
>   #                       for world and kernel targets.
>   # toolchains          - Build a toolchain for all world and kernel targets.
> +#
> +# "quick" way to test all kernel builds:
> +# 	_jflag=`sysctl -n hw.ncpu`
> +# 	_jflag=$(($_jflag * 2))
> +# 	[ $_jflag -gt 12 ]&&  _jflag=12
> +# 	make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
>   #
>   # This makefile is simple by design. [...]

I think it's probably helpful to point out the -j flag, but I'm
not sure I would phrase it as if we're sure that the values here
are the ideal ones.  I expect the ideal values depend too much on
hardware (e.g.: the CPU, type of disk used, and amount of memory
on the machine).  I did a lot of benchmarks of -j a few years
ago on the few machines I owned.  In my case, when I averaged
the results across my machines, the ideal value was more like
ncpu+1, not ncpu*2.

It wouldn't surprise me at all if the ideal value has changed
since I did that.  And it wouldn't surprise me if the ideal
value changes again in the next two years, especially when
one considers the variety of hardware architectures that
FreeBSD runs on.

It's good to mention the make command, the -DMAKE_JUST_KERNELS,
and that using the JFLAG can speed things up.  But I think it
should be said that this min(jcpu*2, 12) recommendation works
well for some hardware, but that people might need to do their
own checking to see what value will work best on their hardware.

Put some short and generic recommendation in the makefile, and
then point people at a man page or some other documentation
for a more detailed explanation.  IMO.

Garance Alistair Drosehn                =     drosih at
Senior Systems Programmer               or   gad at
Rensselaer Polytechnic Institute;             Troy, NY;  USA

More information about the svn-src-head mailing list