Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] emerge -j, make -j and make -l
Date: Mon, 28 Nov 2011 18:53:29
Message-Id: CA+czFiBP+czst5Ec+GLgXudCjiUA23ivAP4nFLQ89MxctM2n7w@mail.gmail.com
In Reply to: Re: [gentoo-user] emerge -j, make -j and make -l by Pandu Poluan
1 On Mon, Nov 28, 2011 at 12:26 AM, Pandu Poluan <pandu@××××××.info> wrote:
2 > On Nov 28, 2011 11:32 AM, "Michael Mol" <mikemol@×××××.com> wrote:
3
4 [snip]
5
6 > Unfortunately, striving for 2*N will inadvertently result in short bursts of
7 >> 2*N, and this potentially induce a stall, which will be very costly. 1.8*N
8 > gives a 10% margin for burst activities, while 1.6*N gives a 20% margin.
9
10 Actually, I suspect that 2*N is normally beneficial as a way to cover
11 for processes blocked on I/O.
12
13 I don't believe processes blocked on I/O are counted in the system's
14 instantaneous load, so they wouldn't be noticed when the kernel polls
15 to build a load average.
16
17 That tells me that, for a load-aware system, you want N for your
18 load-aware calculations, and 2*N (or thereabouts) for numbers which
19 aren't load-aware. Make's -j parameter would be an example of the
20 latter, as it serves as an upper limit when the load average is low,
21 and -l's algorithm keeps saying "go on, go on!"
22
23 I'm currently timing
24
25 MAKEOPTS="-j16 -l13"
26 EMERGE_DEFAULT_OPTS="--jobs --load-average=13"
27
28 with 493 packages (base plus X plus XFCE and chromium, and, of course,
29 USE flags), but I'll start another timed run with
30
31 MAKEOPTS="-j16 -l8"
32 EMERGE_DEFAULT_OPTS="--jobs --load-average=8"
33
34 once that's finished. Last night, I tried with -j16 -l10, and that
35 completed in 209 minutes, but that was still with the
36 PORTAGE_DEFAULT_OPTS typo, so that datapoint is mostly useless. This
37 one has already taken about 240 minutes. At least it's finished
38 building Chromium, now; I hope it doesn't still need to build gcc.
39 It's at 488/493.
40
41 (insert) Just finished:
42
43 real 208m23.880s
44 user 604m27.065s
45 sys 152m22.848s
46
47 Apparently, I misremembered when I started it.
48 (/insert)
49
50 FWIW, I strongly suspect that N should be your number of *logical*
51 cores, not your number of physical cores. I believe most of the
52 overhead
53
54 --
55 :wq

Replies

Subject Author
Re: [gentoo-user] emerge -j, make -j and make -l Michael Mol <mikemol@×××××.com>
Re: [gentoo-user] emerge -j, make -j and make -l Michael Mol <mikemol@×××××.com>