<?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>10818</bug_id>
          
          <creation_ts>2016-12-16 18:22:30 +0000</creation_ts>
          <short_desc>add documentation on stabilizing host build machine performance for kernel&gt;=4.3 and systemd&gt;=228</short_desc>
          <delta_ts>2017-01-10 20:57:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>9</classification_id>
          <classification>Documentation</classification>
          <product>General Docs</product>
          <component>docs-general</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>10 Jan 2017: RESOLVED</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Trevor Woerner">twoerner</reporter>
          <assigned_to name="Scott Rifenbark">srifenbark</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69189</commentid>
    <comment_count>0</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2016-12-16 18:22:30 +0000</bug_when>
    <thetext>This issue might be related to 5594, but 5594 deals with host build machine tweaks for *speed*, whereas this one focuses on *stability*.

I&apos;ve noticed on a busy build machine sporadic issues where a build will fail with the error message:

     fork: Resource temporarily unavailable

and nothing else wrong. Simply restarting the build causes it to succeed without incident. I had been seeing this, maybe, twice a week.

Investigating led me to:

    http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel

which suggests the issue is a combination of
        - linux &gt;= 4.3
        - systemd &gt;= 228

both of which are true when upgrading openSUSE from 42.1 (linux-4.1.36-41/210) to 42.2 (linux-4.4.36-8/228).

The fix appears to be to modify the &quot;DefaultTasksMax&quot; systemd parameter (uncommenting it and setting it to &quot;infinity&quot;). On openSUSE 42.2 this is found in /etc/systemd/system.conf, then

        # systemctl daemon-reexec

or reboot.

I just made this adjustment but given it only happened once or twice a week on
a reasonably busy build machine it might be hard to confirm. I&apos;m also not sure
if setting it to &quot;infinity&quot; is sensible ;-)

I&apos;m guessing other host distros probably also fall into this category.

It would probably be a good idea to update various project documentation (e.g. the quick start guide?) to include a NOTE to this effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69190</commentid>
    <comment_count>1</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2016-12-16 18:24:30 +0000</bug_when>
    <thetext>Apparently, this has been seen on Debian Testing as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69413</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2016-12-30 18:34:43 +0000</bug_when>
    <thetext>Hi Trevor, 

I am copying Paul Eggleton on this issue.  Reading through this seems like it is all about the host build machine configuration.  Maybe I am wrong on that.  Are there any Yocto-specific things going on here?  This is where I need help.

To me, this seems like a build-debugging or release note situation?  Not sure.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69423</commentid>
    <comment_count>3</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2016-12-31 13:32:39 +0000</bug_when>
    <thetext>Hi Scott,

(In reply to comment #2)
&gt; Reading through this seems like
&gt; it is all about the host build machine configuration.  Maybe I am wrong on
&gt; that.

You are exactly correct, this is a host build machine issue.

&gt;  Are there any Yocto-specific things going on here?  This is where I
&gt; need help.
&gt; 
&gt; To me, this seems like a build-debugging or release note situation?  Not
&gt; sure.

If someone has an openSUSE machine running the latest desktop release (Leap 42.2), followed the instructions in, say, the Getting Started Guide, and started a build, there&apos;s a chance that build might fail for completely mysterious reasons with an &quot;out of resources&quot;-type message. Ideally, this will prompt them to go looking for a fix to find out why their build failed and to ask on the mailing list/stackoverflow/IRC. But sometimes when someone&apos;s first build (or one of their first builds) goes bad and causes them to have to dig deeply to find a solution (to something that is known but not mentioned anywhere) they might not be so happy.

Although I gave openSUSE as an example, I want to make absolutely clear this is not an openSUSE-specific issue. The problem is a result of the host running a recent systemd and a recent kernel (not anything openSUSE does). openSUSE very recently had their release, I upgraded, and stumbled on this issue. In time every systemd-based distribution will upgrade their kernels and systemds and they will all be affected.

One of the annoying things about this issue is that it doesn&apos;t happen on every build, it happens sporadically, making it all the more annoying because it will cause overnight Jenkins builds (for example) to fail when they shouldn&apos;t (for example).

I hope the people who manage the Yocto Project&apos;s build machines are aware of this issue so they can tweak the build machines&apos; configurations (if they haven&apos;t already).

I think a note about this configuration tweak should be added *everywhere* because, in time, any build without this tweak could fail mysteriously. I mentioned the Getting Started Guide; ideally any document, blog post, or article that guides a user through their first Yocto/OE build should have an asterisk somewhere referring the reader to this issue to avoid the &quot;bad first impression&quot; syndrome.

After guiding a user through their first build, a document could *optionally* give tips on how to make a build faster. But I don&apos;t think providing them with information to help keep their builds from failing for no apparent reason is something that I would consider to be optional.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69433</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-02 21:49:02 +0000</bug_when>
    <thetext>Trevor, 

Perfect detail.. This helps a lot thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69581</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-06 16:27:55 +0000</bug_when>
    <thetext>Tevor, 

I have crafted a note and put it in a couple steps of the YP Quick Start.  I will also put it in the &quot;Build Overview&quot; section of the YP Reference Manual once we are happy with the verbiage of the note.  These are the two areas in the YP general documentation where a new user is taken through the process of a first build.  

See step 5 of http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.html#building-an-image-for-emulation

The note is replicated here as well - Step 3 of http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.html#building-an-image-for-hardware

Let me know if the note is okay.  Once we are good with it, I will get it into the reference manual as well.  

Regarding other non-mainstream documented areas that might benefit from this note, you might set up a separate bug for those?  I am not sure as I don&apos;t track that part of the documentation.

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69610</commentid>
    <comment_count>6</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2017-01-07 01:53:54 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; See step 5 of
&gt; http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.
&gt; html#building-an-image-for-emulation
&gt; 
&gt; The note is replicated here as well - Step 3 of
&gt; http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.
&gt; html#building-an-image-for-hardware
&gt; 
&gt; Let me know if the note is okay.  Once we are good with it, I will get it
&gt; into the reference manual as well.  

It&apos;s great to see this information being added!

A reboot isn&apos;t needed, simply restarting the build will often cause it to mysteriously succeed when this is the culprit.

I also don&apos;t think it&apos;s necessary to single out openSUSE 42.2 specifically; simply saying &quot;This parameter is found in the system.conf file which is located in /etc/systemd on most systems&quot; would suffice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69667</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-10 18:31:12 +0000</bug_when>
    <thetext>Thanks Trevor for the further feedback on the note.  See the following links and let me know if we are solid for the information.  Once solid, I am going to add similar wording into the appropriate section in the ref-manual:

The note in Step 5 of http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.html#building-an-image-for-emulation

The note in Step 3 of http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.html#building-an-image-for-hardware

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69668</commentid>
    <comment_count>8</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2017-01-10 18:58:49 +0000</bug_when>
    <thetext>Hi Scott, I like this new wording; looks great, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69669</commentid>
    <comment_count>9</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-10 19:11:40 +0000</bug_when>
    <thetext>Thanks Trevor again... 

So I put the note here in the ref-manual (exact same wording) - http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#build-overview.

That covers it for the YP mainstream documentation.  As I mentioned earlier, you might want to open a different bug against documentation that is not in my realm (YP mainstream manuals) if you want someone putting something similar in other areas you think need it.  

I will leave this at IN PROGRESS REVIEW just until you give me the okay on the placement of the note in the ref-manual.  

thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69670</commentid>
    <comment_count>10</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2017-01-10 20:15:53 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; So I put the note here in the ref-manual (exact same wording) -
&gt; http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#build-
&gt; overview.
&gt; 
&gt; I will leave this at IN PROGRESS REVIEW just until you give me the okay on
&gt; the placement of the note in the ref-manual.  

Looks great!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69681</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-10 20:57:11 +0000</bug_when>
    <thetext>Thanks Trevor, 

Setting to RESOLVED and putting the doc flag to &quot;done.&quot;

Scott</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>