<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13306</bug_id>
          
          <creation_ts>2019-04-24 21:20:57 +0000</creation_ts>
          <short_desc>bitbake starts up to n^2 processes with n cpus</short_desc>
          <delta_ts>2026-01-29 16:22:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.7</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Bunk">bunk</reporter>
          <assigned_to name="Randy MacLeod">randy.macleod</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tvgamblin</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83634</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Bunk">bunk</who>
    <bug_when>2019-04-24 21:20:57 +0000</bug_when>
    <thetext>With n cores bitbake runs up to n tasks in parallel, and each might start up to n processes.

E.g. on an 8-core CPU it is not uncommon that 8 compile tasks are running, each with 8 gcc processes. That&apos;s 64 processes competing for the same CPU/RAM/IO resources.

There is no obvious simple solution that comes into my mind, but with n cpus the goal should be n cpu-bound processes and not up to n^2 processes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83639</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-04-25 11:46:44 +0000</bug_when>
    <thetext>We did have a proof of concept for one idea to handle this:
http://lists.openembedded.org/pipermail/openembedded-core/2015-February/101489.html

Sadly we never finished debugging the issues it had.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83660</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2019-04-26 02:24:04 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; With n cores bitbake runs up to n tasks in parallel, and each might start up
&gt; to n processes.
&gt; 
&gt; E.g. on an 8-core CPU it is not uncommon that 8 compile tasks are running,
&gt; each with 8 gcc processes. That&apos;s 64 processes competing for the same
&gt; CPU/RAM/IO resources.
&gt; 
&gt; There is no obvious simple solution that comes into my mind, but with n cpus
&gt; the goal should be n cpu-bound processes and not up to n^2 processes.

I&apos;ve tried to adjust PARALLEL_MAKE and BB_NUMBER_THREADS several months ago,
but didn&apos;t get a better result, the cpu count is nearly the best choice,
you can try it if you like. The building process is a little complicated, not only related to CPU, but also memory and disk, and also parallel build (task dependencies).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83661</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2019-04-26 02:27:43 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; We did have a proof of concept for one idea to handle this:
&gt; http://lists.openembedded.org/pipermail/openembedded-core/2015-February/
&gt; 101489.html
&gt; 
&gt; Sadly we never finished debugging the issues it had.

Is this similar to &quot;make -l&quot;, please?

       -l [load], --load-average[=load]
            Specifies  that no new jobs (commands) should be started if there are others jobs running and the load average is at least load (a
            floating-point number).  With no argument, removes a previous load limit.


I&apos;ve tried to add &quot;-l &lt;number&gt;&quot; to PARALLEL_MAKE several months ago, but didn&apos;t make much difference in build time, except found several parallel build issues, and I&apos;ve fixed these issues in oe-core.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83662</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2019-04-26 02:27:58 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; We did have a proof of concept for one idea to handle this:
&gt; http://lists.openembedded.org/pipermail/openembedded-core/2015-February/
&gt; 101489.html
&gt; 
&gt; Sadly we never finished debugging the issues it had.

Is this similar to &quot;make -l&quot;, please?

       -l [load], --load-average[=load]
            Specifies  that no new jobs (commands) should be started if there are others jobs running and the load average is at least load (a
            floating-point number).  With no argument, removes a previous load limit.


I&apos;ve tried to add &quot;-l &lt;number&gt;&quot; to PARALLEL_MAKE several months ago, but didn&apos;t make much difference in build time, except found several parallel build issues, and I&apos;ve fixed these issues in oe-core.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89297</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-02-18 16:04:28 +0000</bug_when>
    <thetext>Robert, Is Richard&apos;s work mostly read to merge in your opinion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89557</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-03-09 16:46:34 +0000</bug_when>
    <thetext>Future isn&apos;t the right target milestone. Set to 3.99 and CC RP.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96785</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-24 14:24:18 +0000</bug_when>
    <thetext>Bulk move from 4.99 or 0.00 to 5.99</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104112</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-01-29 16:22:04 +0000</bug_when>
    <thetext>Randy and Martin Hundebøll have a patch. 
Randy is adding tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>