On Sun, Nov 27, 2011 at 12:56 PM, Pandu Poluan <pa...@poluan.info> wrote:
> On Nov 27, 2011 5:12 PM, "Michael Mol" <mike...@gmail.com> wrote:

[snip]

>
> Here's my experience:
>
> I always experience emerge failures on my Gentoo VMs if I use MAKEOPTS=-j>3.
> Not all packages, but many. Including, IIRC, glibc and gcc.

In my barebones 177-package state, I didn't get any build failures
from parallel building, either via emerge -j or make -j. I did get one
failure when I went to install X that worked fine on the second
attempt.

Parallel operations are finicky things; if you don't define the
relationships correctly, you can have things work fine most of the
time, and then a race condition between one make recipe and another
(or perhaps between one ebuild and another; a revdep-rebuild afterward
might not be a bad CYA) causes one thing to fail, just this one time.

My day job is C++ on Windows[1], and we do a *lot* with multithreaded
code. Race conditions are a PITA; you might not be able to reproduce a
race-induced failure on any of the workstations or test systems you
have, but then have it crop up consistently on a customer's system.
The same principles can and will apply with things like parallel make
and parallel emerge. I've even seen it happen in VS2005 and VS2008
parallel builds.

> This happens even if I make sure that there's just one emerge job being
> done. And this happens even if I allocate more vCPUs than -j, on VMware and
> XenServer alike.

FWIW, I've been running with MAKEOPTS=-j10 on my Phenom 9650 for over
a year. It's very rare that something breaks due to the parallel
build. I think it's happened perhaps three times, and each time was
resolvable with a retry. YMMV, of course; race conditions are finicky.

> I don't know where the 'blame' lies, but I've found myself standardizing on
> MAKEOPTS=-j3, and PORTAGE_DEFAULT_OPTS="--jobs
> --load-average=<1.6*num_of_vCPU>"
>
> (Yes, no explicit number of jobs. The newer portages are smart enough to
> keep starting new jobs until the load number is reached)

Sweet; I didn't know about Portage's --load-average; I'll definitely
switch to that instead of -j. Load-driven make plus load-driven
portage should work beautifully on my system.

I'll steal your 1.6 factor, and give:
    MAKEOPTS=-j <2*N> -l <1.6*N)
    PORTAGE_DEFAULT_OPTS="--jobs --load-average<1.6*N>"
a try.

How does that interact with distcc, by the way? I've got two of these
octo-core Xeon boxes, and I've still got my Phenom 9650--distcc on my
home network should become very, very nice. And this box is consuming
255W at the wall with monitor off, 326W with monitor on. That's not
bad. Though perhaps I should move to an apartment where heat isn't
free...

[1] Well, for most of this year, my task list has been more
PHP-oriented, but I'm still on tap for our C++ work.

-- 
:wq

Reply via email to