2015-07-14 23:47:53

by Ken Moffat

[permalink] [raw]
Subject: make -jN (n>1) ineffective in 4.2.0-rc on AMD Phenom

One of my machines is an AMD Phenom. I wanted to explore building
some new (to me) userspace, and this machine had a system which was
both recent enough (last month's LFS/BLFS) and with enough space to
make it seem like a good place to do it.

I finally got round to trying to build qt-5 (5.5.0), running
4.2.0-rc1. For the minor packages before qt I had been building one
or two at a time, and leaving the machine. I'm using MAKEFLAGS of
'-j4 -O'. For qt I was a bit surprised to see that the system only
appeared to be using one CPU whenever I checked it (looking at the
taskbar cpu window in icewm), but I assumed that I was probably
looking at inopportune times (i.e. waiting for some dependency to
complete). That build eventually failed in the qtwebengine part
(known problem with gcc-5.1, a patch for gcc is available), but only
after six and a quarter hours.

At that point I suspected that something might be wrong in my
scripts, but I eventually confirmed that my MAKEFLAGS were indeed
being picked up. Then I fired up 'top' (procps-ng-3.3.10) and saw
that CPU usage was indeed maxing out at 100% (instead of the
expected 400%).

Back to 4.1.0, started the qt build - during the (long) configure
step the CPU total was between 100% and 115% (Xorg, 3 rxvt-unicode
terms, one vim session, one buildscript, and top) and then it
approached 400% as soon as 'make' started.

At that stage I assumed I must have somehow buggered up the 4.2
config - if everybody was hitting this sort of slowdown, somebody
would surely have noticed. So, I downloaded 4.2.0-rc2 and built
that from 4.1.1, taking care to think about each configure option
(but nothing jumped out as likely to be relevant). Booted that, but
the problem continues.

If I build _any_ package using MAKEFLAGS of '-j4 -O' it still only
gets the equivalent of one CPU. Even a manual 'make -j4' (to ensure
it isn't a script problem). I haven't been building much since
I installed 4.2-rc1, not sure if the problem is specific to this
config / this system.

The machine is an AMD Phenom(tm) II X4 965 Processor and gcc is
5.1.0. I'll attach my config, and also a diff from the good 4.1.0
config in case it is something obvious. Meanwhile, I'll go back to
4.1 to contine my attempt to test the new userspace packages. I
suppose that I can bisect it if I have to, but at the moment this is
not a good time.

ĸen
--
This one goes up to eleven!
(for this case, "goes up to one" would be better ;-)


Attachments:
(No filename) (2.41 kB)
config-4.2.0-rc2 (80.52 kB)
config-changes (12.41 kB)
Download all attachments

2015-07-15 00:13:15

by Ken Moffat

[permalink] [raw]
Subject: Re: make -jN (n>1) ineffective in 4.2.0-rc on AMD Phenom

On Wed, Jul 15, 2015 at 12:39:20AM +0100, Ken Moffat wrote:
>
> At that stage I assumed I must have somehow buggered up the 4.2
> config - if everybody was hitting this sort of slowdown, somebody
> would surely have noticed. So, I downloaded 4.2.0-rc2 and built
> that from 4.1.1, taking care to think about each configure option
> (but nothing jumped out as likely to be relevant). Booted that, but
> the problem continues.
>
In fact, I built it from 4.1.0 as the diff of the two configs shows.

ĸen
--
This one goes up to eleven!

2015-07-15 02:23:36

by Jeff Epler

[permalink] [raw]
Subject: Re: make -jN (n>1) ineffective in 4.2.0-rc on AMD Phenom

GNU Make 4.1 has a problem that causes it to be unable to use the
desired level of parallelism. Two people have reported that reverting a
commit which changes from fork to vfork "fixes" it. (i'm one of them,
unfortunately posting as anonymous in the tracker).

Hoewver, if you are also seeing the linux kernel version as relevant to
producing the problem, that's quite interesting, and the underlying
cause may be different. We reproduced the problem on a range of older
kernels, from 3.2 to 3.18.

http://savannah.gnu.org/bugs/?44555

Jeff

2015-07-15 12:28:13

by Ken Moffat

[permalink] [raw]
Subject: Re: make -jN (n>1) ineffective in 4.2.0-rc on AMD Phenom

On Tue, Jul 14, 2015 at 09:23:31PM -0500, Jeff Epler wrote:
> GNU Make 4.1 has a problem that causes it to be unable to use the
> desired level of parallelism. Two people have reported that reverting a
> commit which changes from fork to vfork "fixes" it. (i'm one of them,
> unfortunately posting as anonymous in the tracker).
>
> Hoewver, if you are also seeing the linux kernel version as relevant to
> producing the problem, that's quite interesting, and the underlying
> cause may be different. We reproduced the problem on a range of older
> kernels, from 3.2 to 3.18.
>
> http://savannah.gnu.org/bugs/?44555
>
> Jeff

Thanks, but I think this is a different problem, I was probably not
clear : I specify make -j4 and make does indeed run 4 jobs, but it
is only getting the equivalent of 1 CPU instead of 4. It is
running 4 jobs, but on the equivalent of 1 processor (so this takes
much longer than -j1).

The reason I think it is a different problem is that I upgraded to
make-4.1 in November and everything has been fine until now.

With 'top' from procps-ng-3.3.10 the display can show how active
each CPU is (indeed, I think that is the default) - on earlier
versions of 'top' I think that the output was very different.

ĸen
--
This one goes up to eleven!