From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: Re: PARALLEL_MAKE
Date: Fri, 13 Mar 2009 12:07:32 -0400 [thread overview]
Message-ID: <20090313160732.GA26615@denix.org> (raw)
In-Reply-To: <018101c9a3f0$7f5b2cd0$5e3018ac@Glamdring>
On Fri, Mar 13, 2009 at 04:27:08PM +0100, Ulf Samuelsson wrote:
>>>> 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.
Ah, I see. I'm not sure what is the percentage of "broken" packages...
>>> 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.
First of all, I believe -j`2*n` is very agressive. I've seen other suggestions
of using -j`n+1` or -j`n+2`.
Second, your Core i7 still has 4 real cores. Even though HyperThreading
presents each core as 2 virtual ones, those are not real 8 cores. And
according to [1], sometimes using HyperThreading may degrade the overall
performance...
So, you should experiment with your settings and find a sweet spot, which
maybe somewhere between 4 and 16 threads :)
[1] http://en.wikipedia.org/wiki/Hyper-threading
--
Denys
next prev parent reply other threads:[~2009-03-13 16:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 23:32 PARALLEL_MAKE Ulf Samuelsson
2009-03-13 0:23 ` PARALLEL_MAKE Mike (mwester)
2009-03-13 1:38 ` PARALLEL_MAKE Khem Raj
2009-03-13 3:49 ` PARALLEL_MAKE Denys Dmytriyenko
2009-03-13 6:05 ` PARALLEL_MAKE Tom Rini
2009-03-13 14:19 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-13 14:56 ` PARALLEL_MAKE Denys Dmytriyenko
2009-03-13 15:27 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-13 16:07 ` Denys Dmytriyenko [this message]
2009-03-13 16:20 ` PARALLEL_MAKE Frans Meulenbroeks
2009-03-13 16:57 ` PARALLEL_MAKE Tom Rini
2009-03-14 10:29 ` PARALLEL_MAKE Frans Meulenbroeks
2009-03-14 17:42 ` PARALLEL_MAKE Tom Rini
2009-03-16 9:24 ` PARALLEL_MAKE Richard Purdie
2009-03-13 17:18 ` PARALLEL_MAKE Richard Purdie
2009-03-13 17:48 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-17 16:28 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-17 20:06 ` PARALLEL_MAKE Denys Dmytriyenko
2009-03-18 5:31 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-17 21:11 ` PARALLEL_MAKE Tom Rini
2009-03-18 5:39 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-13 17:14 ` PARALLEL_MAKE Richard Purdie
2009-03-13 17:12 ` PARALLEL_MAKE Richard Purdie
2009-03-13 12:47 ` PARALLEL_MAKE Marcin Juszkiewicz
2009-03-13 13:00 ` PARALLEL_MAKE Philip Balister
2009-03-13 13:07 ` PARALLEL_MAKE Sledz, Steffen
2009-03-13 14:19 ` PARALLEL_MAKE Ulf Samuelsson
2009-03-13 15:04 ` PARALLEL_MAKE Denys Dmytriyenko
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=20090313160732.GA26615@denix.org \
--to=denis@denix.org \
--cc=openembedded-devel@lists.openembedded.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.