Multi-Threaded make

JD jd1008 at gmail.com
Thu Nov 29 16:04:48 UTC 2012


On 11/29/2012 04:24 AM, Gabriel VLASIU wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, 28 Nov 2012, JD wrote:
>
>> Date: Wed, 28 Nov 2012 15:37:54 -0700
>> From: JD <jd1008 at gmail.com>
>> To: Community support for Fedora users <users at lists.fedoraproject.org>
>> User-Agent: Mozilla/5.0 (X11; Linux i686;
>>      rv:15.0) Gecko/20120911 Thunderbird/15.0.1
>> X-Spam-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,
>>      DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,
>>      RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID autolearn=ham version=3.3.1
>> Subject: Multi-Threaded make
>>
>> While building the kernel from source RPM, I run
>> the command ps -ef | grep make in another terminal,
>> and I do see that 4 make processes are running, with
>> each one building objects for a different kernel source
>> directory.
>>
>> However, something else seems to be single threaded
>> which is causing the huge delay in finishing kernel build.
>>
>> I found that when I run top to see the upper-most
>> cpu consumers, I see only one cc1 process at the top.
>>
>> So I ran ps again to see how many cc1 processes there
>> are.
>>
>> Always - just one cc1 process.
>>
>> I would expect to see anywhere from 1 to 4 cc1 processes
>> at a time. But that is not the case.
>>
>> What is forcing only a single instance of cc1 at a time?
>>
>> I hope the devs can have a look at either the compiler
>> tools or the make util.
> make is invoked from kernel.spec file like this:
>
> make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
> make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
>
> where %{?_smp_mflags} is:
> 1 core : -j 1
> 2 cores: -j 2
> 4 cores: -j 4
> ...
>
> You can see multiple make proccesses. But only 2 (in my case) do the real
> work:
> user1  22073 12810  0 13:13 pts/0    00:00:00 make -f scripts/Makefile.build obj=fs
> user1  24474 22073  0 13:15 pts/0    00:00:00 make -f scripts/Makefile.build obj=fs/cifs
> user1  24530 22073  0 13:15 pts/0    00:00:00 make -f scripts/Makefile.build obj=fs/coda
>
> Make proccess with pid 22073 only invoke two addititonal make proccesses
> which call cc1:
> user1  3617  3616  0 13:21 pts/0    00:00:00 /usr/libexec/gcc/x86_64-redhat-linux/4.7.2/cc1 -quiet -nostdinc ....
> user1  3627  3626  0 13:21 pts/0    00:00:00 /usr/libexec/gcc/x86_64-redhat-linux/4.7.2/cc1 -quiet -nostdinc ...
>
> One cc1 -> one core or you called make with -j 1.
>
>
> Gabriel
>
That does not make sense.
I have a unicore!! An old Athlon64 3700+,
and yet ps -ef shows up to 4 makes running at a time.


More information about the users mailing list