[oe] PARALLEL_MAKE

Ulf Samuelsson ulf.samuelsson at atmel.com
Fri Mar 13 15:27:08 UTC 2009


>>> On the dual dual-core (4 total) boxes I have, I do -j6/4 threads.  On my
>>> new quad-core box I haven't yet had a chance to figure out what's best.
>>> I also use -j6/4 threads on an older dual-core amd64 box we've got
>>> around and that seems best for my tasks at least (I tried a few
>>> combinations of more jobs/threads and less and both were slower).
>>>
>>
>> I looked at a few recipies which by a stanrge coincidence had
>> PARALLEL_MAKE="",
>
> That's not a strange coincidence, that means a specific package has issues
> building in parallel - usually some dependencies go out of order.
>

The strange coincidence was that *ALL*  the packages I *looked* at
had PARALLEL_MAKE="".
I made the erroneous assumption that most packages were this way.

>> When, I rechecked, I had
>> PARALLEL_MAKE ="-j 16"
>> as well and this should be
>> PARALLEL_MAKE ="-j16"
>
> Having only 4 cores and setting number of parallel makes to 16 kills your
> performance, as system spends more time switching contexts instead of 
> actually
> doing something useful - i.e. compiling.

The Core i7 has 4 cores and each core has two virtual CPUs so the system 
sees 8 CPUs.
I saw some commone from someone claiming that if
you have n CPUs, then Buildroot should use make -j`2*n`.

I thought about this, and came up with the following explanation.
If you have one job per CPU, then  whenever you have to wait for the 
harddisk, you stall this CPU.
If you have several jobs per CPU, then you can gain some time
by running the second job while the first job was waiting for the hard disk.

Whether this works in practice, I cannot say, but it would be interesting
to have some real proof.

>
>> Changed to
>> PARALLEL_MAKE ="-j8"
>> BB_NUMBER_THREADS = "2"
>>
>> I see some more cores beeing used.
>> The initial setup after you changed local.conf seems to run on a single
>> core though.
>
> After you change your configuration, bitbake rebuilds the cache - that is 
> a
> single threaded operation, hence uses only one core.
>
> -- 
> Denys


Best Regards
Ulf Samuelsson






More information about the Openembedded-devel mailing list