From: "Mikko Rapeli" <mikko.rapeli@bmw.de>
To: <richard.purdie@linuxfoundation.org>
Cc: <ross@burtonini.com>, <yocto@lists.yoctoproject.org>
Subject: Re: [yocto] What are the key factors for yocto build speed?
Date: Thu, 19 Mar 2020 11:43:23 +0000 [thread overview]
Message-ID: <20200319114322.GX104502@korppu> (raw)
In-Reply-To: <bcab55b919af5da30e9b8fe3db0cc6537ac3f785.camel@linuxfoundation.org>
On Thu, Mar 19, 2020 at 11:04:26AM +0000, Richard Purdie wrote:
> On Thu, 2020-03-19 at 08:05 +0000, Mikko Rapeli wrote:
> > Once this is done, IO still happens when anything calls sync() and
> > fsync() and worst offenders are package management tools. In yocto
> > builds, package manager actions to flush to disk are always useless
> > since rootfs images are going to be compressed and original ones
> > wiped by rm_work anyway.
> > I've tried to hook eatmydata library into the build which makes
> > sync() and fsync() calls no-ops but I've still failed to fix all the
> > tools and processes called during build from python code. For shell
> > based tasks this does it:
> >
> > $ export LD_LIBRARY_PATH=/usr/lib/libeatmydata
> > $ export LD_PRELOAD=libeatmydata.so
> > $ grep -rn LD_PRELOAD conf/local.conf
> > conf/local.conf:305:BB_HASHBASE_WHITELIST_append = " LD_PRELOAD"
> > conf/local.conf:306:BB_HASHCONFIG_WHITELIST_append = " LD_PRELOAD"
>
> Doesn't pseudo intercept and stop these sync calls already? Its
> supposed to so if its not, we should fix that.
I will double check, but I'm sure I see IO going to disk when plenty of RAM
is still available in page cache.
> > The effect is clearly visible during build time using Performance Co-
> > Pilot (pcp) or similar tools to monitor CPU, memory, IO and network
> > IO. The usage of RAM as page cache grows until limits are hit and
> > only then writes to disk start, except for the python image
> > classes... Hints to fix this are welcome!
> >
> > To my knowledge of monitoring our builds, there is a lot of
> > optimization
> > potential to better build times. CPU are under utilized during
> > bitbake recipe parsing
>
> Recipe parsing should hit 100% CPU, its one of the few places we can do
> that.
I'm not fully aware what bitbake does before starting task execution.
With sumo, there is an initial spike in CPU use and then a long single
thread wait where log shows "Initialising tasks..." and Cooker process
is using a single core. For me this takes at least one minutes for
every build. Same is visible with zeus too.
Example graph from pmchart:
https://mcfrisk.kapsi.fi/temp/bitbake_start_to_task_execution.png
> > , fetch, configure, package and rootfs tasks.
>
> Sadly these tasks are much harder.
Yep.
> > Memory is not fully utilized either since IO through sync()/fsync()
> > happens everywhere
>
> non-pseudo tasks?
I'll try to check this case once more.
-Mikko
next prev parent reply other threads:[~2020-03-19 11:43 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 12:52 What are the key factors for yocto build speed? Oliver Westermann
2020-03-18 13:01 ` [yocto] " Mikko Rapeli
2020-03-18 13:29 ` Paul Barker
2020-03-18 14:12 ` Jean-Marie Lemetayer
2020-03-18 14:30 ` Alexander Kanavin
2020-03-18 14:49 ` Adrian Bunk
2020-03-18 15:09 ` Mike Looijmans
2020-03-18 15:51 ` Mikko Rapeli
2020-03-18 17:13 ` <EXT> " Srini
2020-03-18 17:47 ` David Stewart
2020-03-18 18:12 ` Yann Dirson
2020-03-18 18:15 ` Srini
2020-03-20 16:32 ` Philip Balister
2020-03-19 6:27 ` Mike Looijmans
2020-03-21 18:43 ` Oliver Westermann
2020-03-18 14:09 ` [yocto] " Mike Looijmans
2020-03-18 22:56 ` Ross Burton
2020-03-19 8:05 ` Mikko Rapeli
2020-03-19 11:04 ` Richard Purdie
2020-03-19 11:43 ` Mikko Rapeli [this message]
2020-03-19 11:48 ` Richard Purdie
2020-03-19 16:07 ` Mike Looijmans
2020-03-19 16:29 ` Yann Dirson
2020-03-19 17:04 ` Richard Purdie
2020-03-19 18:09 ` Yann Dirson
2020-03-19 17:21 ` Adrian Bunk
2020-03-19 17:26 ` Richard Purdie
2020-03-20 14:58 ` Mike Looijmans
2020-03-20 17:24 ` Adrian Bunk
2020-03-19 18:23 ` Khem Raj
[not found] ` <15FD6B43E957AFDB.13190@lists.yoctoproject.org>
2020-03-18 14:36 ` Mike Looijmans
2020-03-18 15:38 ` Martin Jansa
2020-03-21 18:39 ` Oliver Westermann
2020-03-21 18:58 ` [yocto] " Martin Jansa
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=20200319114322.GX104502@korppu \
--to=mikko.rapeli@bmw.de \
--cc=richard.purdie@linuxfoundation.org \
--cc=ross@burtonini.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox