All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferry Toth <fntoth@gmail.com>
To: yocto@lists.yoctoproject.org
Subject: Re: bitbake controlling memory use
Date: Tue, 3 Jan 2023 15:15:22 +0100	[thread overview]
Message-ID: <89e0c314-86ca-6fb4-642c-7493116b467f@gmail.com> (raw)
In-Reply-To: <26729316-8d42-3ec9-d6b5-f77002a85c74@windriver.com>

Op 13-06-2021 om 02:38 schreef Randy MacLeod:
> On 2021-06-12 12:31 p.m., Ferry Toth wrote:
>> Hi
>>
>> Op 10-06-2021 om 22:35 schreef Ferry Toth:
>>> Hi,
>>>
>>> Op 10-06-2021 om 21:06 schreef Trevor Gamblin:
>>>>
>>>>
>>>> On 2021-06-10 5:22 a.m., Ferry Toth wrote:
>>>>>
>>>>> **[Please note: This e-mail is from an EXTERNAL e-mail address]
>>>>>
>>>>> Hi Trevor,
>>>>>
>>>>> Gmane is really messing things up here, sorry about that. I need to 
>>>>> create a new thread I'm afraid.
>>>>>
>>>>> I'd like to your reworked patch.
>>>>>
>>>>> But note, I reworked it too (but maybe wrongly). I builds like 90% 
>>>>> of my image, but fails building cmake-native. Or more accurately it 
>>>>> fails do_configure while trying to build a small test program.
>>>>
>>>> Hi,
>>>>
>>>> I've pushed the patch onto my fork of the poky repo at 
>>>> https://github.com/threexc/poky
>>>>
>>>> Let me know how your testing turns out - I am still running tests as 
>>>> well, but it would be good to know how others' attempts turn out, 
>>>> and more changes could still end up being necessary.
>>>>
>>> Your patch didn't apply clean on Gatesgarth, but fix seemd trivial. 
>>> With this it builds cmake-native fine, thanks!
>>>
>>> You can find it here: 
>>> https://github.com/htot/meta-intel-edison/commit/8abce2f6f752407c7b2831dabf37cc358ce55bc7
>>>
>>> I will check if any other build errors occurs, and if not will try to 
>>> time image build with and without the patch to compare performance 
>>> and see if it worth the effort.
>>
>> It works fine. To measure time I first built 
>> https://github.com/htot/meta-intel-edison (gatesgarth), so everything 
>> needed is downloaded and cached. Then prior to each run I `rm -rf out` 
>> and `rm -rf bbcache/sstate-cache/*` to force everything to rebuild. 
>> And then `time bitbake -k edison-image`
>>
>> With patch:
>> real    218m12,686s
>> user    0m24,058s
>> sys     0m4,379s
>>
>> Without:
>> real    219m36,944s
>> user    0m24,770s
>> sys     0m4,266s
>>
>> Strange, I expected more.

I have a new machine now. I has 16 HT, but only 16GB RAM. So memory 
starvation has now become a serious issue, especially when building 
nodejs in parallel to nodejs-native.

There are 2 issues:
1 - nodejs tries to link 5 executables in parallel, each requires 4GB 
RAM. This I solved by serializing the linker using `flock` for the 
nodejs recipe.
2 - nodejs starts 16 compile submakes and so does nodejs-native. Each is 
between 0.5GB - 1GB RAM.

For the 2nd problem the "Add shared make jobserver support" patch would 
likely be effective. I've fixed it up for Kirkstone, but it is not working.

I noted: since make v4.2 we need to use `--jobserver-auth=fifo:" + fifoname`

But the real problem seems to be `if "BB_MAKEFIFO" in os.environ:` in 
make-intercept fails, even though `self.cfgData.setVar("BB_MAKEFIFO", 
fifoname)` succeeds in `def setup_make_fifo(self):`.

So, either BB_MAKEFIFO is not yet created at make time, or no longer 
exists.

Confused again.

> Hi Ferry,
> 
> Thanks for the update.
> 
> Trevor and I saw similar (lack of ) results.
> 
> Trevor even trying getting kea, which uses 'make' to be done the
> 'configure' stage, for two builds in differect dirs. Then to run the two
>     'bitbake -c compile kea'
> with and with out the patch with the expectation that with the
> job server patch and the right number of jobs, the two builds would
> take longer. I don't know the exact timing but there was no
> noticeable difference.
> 
> We did strace things to confirm that the make wrapper was being called
> and the actual make was being called by the wrapper. I suspect that
> the next thing we try will be to patch 'make' to log when the jobserver
> kicks in or to play with some make jobserver demo such as:
>     https://github.com/olsner/jobclient
> to get some experience with how things are supposed to work and
> to be able to strace a successful use of the job server feature.
> 
> A little RTFM / UTSL may also be required.
> 
> ../Randy
> 
> 
>>
>> This is on 4 core/8ht i7-3770 CPU @ 3.40GHz with 16Gb RAM and nodejs 
>> restricted to -j 2 (so that alone takes ~ 60min to build).
>>
>>>> - Trevor
>>>>
>>>>>
>>>>> Ferry
>>>>>
>>>>>
>>>>>
>>
>>
>>
>>
> 
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#53849): https://lists.yoctoproject.org/g/yocto/message/53849
> Mute This Topic: https://lists.yoctoproject.org/mt/82015730/4382963
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [gley-yocto@m.gmane-mx.org]
> -=-=-=-=-=-=-=-=-=-=-=-
> 




  parent reply	other threads:[~2023-01-03 14:15 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 15:23 bitbake controlling memory use Gmane Admin
2021-04-11 15:27 ` [yocto] " Alexander Kanavin
2021-04-11 15:49   ` Gmane Admin
2021-04-11 15:55     ` [yocto] " Alexander Kanavin
2021-04-11 16:08       ` Gmane Admin
2021-04-11 16:19         ` [yocto] " Alexander Kanavin
2021-04-14  1:14           ` Randy MacLeod
2021-04-14  3:14             ` Khem Raj
2021-04-14  4:59             ` Richard Purdie
2021-04-17 22:17               ` Gmane Admin
2021-04-18  9:59                 ` [yocto] " Richard Purdie
2021-04-18 19:34                   ` Gmane Admin
     [not found]                   ` <16770AD5E94DEAE5.1089@lists.yoctoproject.org>
2022-12-24 18:58                     ` Ferry Toth
2022-12-26  2:11                       ` [yocto] " Randy MacLeod
2022-12-27 16:56                         ` Ferry Toth
2021-06-05 13:35               ` Gmane Admin
2021-06-08 19:08                 ` [yocto] " Trevor Gamblin
2021-06-10  7:09                   ` Gmane Admin
     [not found]               ` <1685B30F5819A655.13459@lists.yoctoproject.org>
2021-06-07 19:27                 ` Gmane Admin
2021-06-08 19:12                   ` [yocto] " Trevor Gamblin
2021-06-10  9:22                   ` Ferry Toth
2021-06-10 19:06                     ` [yocto] " Trevor Gamblin
2021-06-10 20:35                       ` Ferry Toth
2021-06-12 16:31                         ` Ferry Toth
2021-06-13  0:38                           ` Randy MacLeod
2021-06-13 10:58                             ` Ferry Toth
2023-01-03 14:15                             ` Ferry Toth [this message]
2023-01-03 14:18                               ` Alexander Kanavin
2023-01-03 14:29                                 ` Ferry Toth
2023-01-03 14:36                                   ` Quentin Schulz
2023-01-03 14:41                                     ` Ferry Toth
2023-01-03 15:03                                       ` Janne Kiiskila
2023-01-03 15:12                                         ` Ferry Toth
2023-01-03 15:24                                           ` Alexander Kanavin
     [not found]                                           ` <1736D5DCC66BC3DE.4716@lists.yoctoproject.org>
2023-01-03 15:37                                             ` Alexander Kanavin
2023-01-03 15:58                                               ` Ferry Toth
2023-01-03 17:33                                                 ` Alexander Kanavin
2023-01-08 22:13                                                   ` Ferry Toth
2023-01-09 10:39                                                     ` Alexander Kanavin
2023-01-09 10:43                                                       ` Richard Purdie
2023-01-09 10:54                                                         ` Ferry Toth
2023-01-19 19:59                                                           ` Ferry Toth
2023-01-09 10:49                                                       ` Ferry Toth
2023-01-10  1:57                                                         ` Randy MacLeod
2023-01-10  9:24                                                           ` Ferry Toth
2023-01-14 22:33                                                             ` Ferry Toth
2023-08-28 12:56                                                               ` Martin Hundebøll
2023-01-03 15:44                                   ` Martin Jansa
2021-04-12  2:25 ` Chen Qi
2021-04-12 18:45   ` Gmane Admin
2021-04-12  8:13 ` [yocto] " Robert Berger
2021-04-12 18:47   ` Gmane Admin
     [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.12d167de-8268-4441-bd03-b78a3e04713e@emailsignatures365.codetwo.com>
     [not found]   ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.a8aa18ca-4a64-4525-851c-c6d34f355f1f@emailsignatures365.codetwo.com>
2021-04-12  8:28     ` [yocto] " Mike Looijmans

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=89e0c314-86ca-6fb4-642c-7493116b467f@gmail.com \
    --to=fntoth@gmail.com \
    --cc=yocto@lists.yoctoproject.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.