<div dir="ltr"><div>Probably in this case it is better to add a patch that allows HIGH_RLIMIT_NOFILE to be configured from the systemd recipe via meson switches, and offer that to systemd upstream.</div><div><br></div><div>Alex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 19 Aug 2019 at 16:25, Hongxu Jia &lt;<a href="mailto:hongxu.jia@windriver.com">hongxu.jia@windriver.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <div class="gmail-m_-7060366043772446825moz-cite-prefix">On 8/19/19 10:01 PM, Alexander Kanavin
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>Should the limit be simply raised? The 256M setup is
          crumbling on several fronts (runtime tests, modernisation of
          X, various non-x86 qemu targets). Adding per-image/target
          exceptions, custom non-upstreamable patches, or sticking to
          deprecated configurations isn&#39;t the right thing to do, I
          think.<br>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    <p>The modification of set default RLIMIT_NOFILE(4k) just keeps sync
      with the one in sysvinit,</p>
    <p>if the fronts you mentioned are working fine on sysvinit, I think
      it should be OK on systemd<br>
    </p>
    <p>but whether it has side effect or not still depends on the result
      of image test</p>
    <p><br>
    </p>
    <p>The fix is trying to fix the blocking issue while switching init
      manager from sysvinit to systemd for poky</p>
    <p><br>
    </p>
    <p>Hi RP,</p>
    <p>Should we make HIGH_RLIMIT_NOFILE configurable from local.conf?</p>
    <p>Then we could modify it according to the requirement, such as set
      it to 4k at image test <br>
    </p>
    <p>//Hongxu<br>
    </p>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Alex<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, 19 Aug 2019 at 15:34,
          Hongxu Jia &lt;<a href="mailto:hongxu.jia@windriver.com" target="_blank">hongxu.jia@windriver.com</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Since
          do_testimage for core-image-sato-sdk has memory limitation
          (256Mib)<br>
          which caused rpc.statd failed with out of memory.<br>
          [  531.306146] Out of memory: Kill process 193 (rpc.statd)
          score 200 or sacrifice child<br>
          <br>
          The rpc.statd allocates memory according to RLIMIT_NOFILE,<br>
          so decrease it to 4k to keep sync with sysvinit<br>
          <br>
          After applying the patch, the memory cost is the same with
          sysvinit<br>
          rpcuser    340  0.0  1.0   3212  2588 ?        Ss   13:20 
           0:00 /usr/sbin/rpc.statd -F<br>
          root       473  0.0  0.2   3464   496 ?        Ss   13:23 
           0:00 /usr/sbin/rpc.mountd<br>
          <br>
          Signed-off-by: Hongxu Jia &lt;<a href="mailto:hongxu.jia@windriver.com" target="_blank">hongxu.jia@windriver.com</a>&gt;<br>
          ---<br>
           ...0001-decreasing-the-default-RLIMIT_NOFILE.patch | 35
          ++++++++++++++++++++++<br>
           meta/recipes-core/systemd/<a href="http://systemd_242.bb" rel="noreferrer" target="_blank">systemd_242.bb</a> 
                   |  4 +++<br>
           2 files changed, 39 insertions(+)<br>
           create mode 100644
meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch<br>
          <br>
          diff --git
a/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch
b/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch<br>
          new file mode 100644<br>
          index 0000000..fb8e2c9<br>
          --- /dev/null<br>
          +++
b/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch<br>
          @@ -0,0 +1,35 @@<br>
          +From 55c7196163e481c508fa708b9b8f5e7bf2d2f007 Mon Sep 17
          00:00:00 2001<br>
          +From: Hongxu Jia &lt;<a href="mailto:hongxu.jia@windriver.com" target="_blank">hongxu.jia@windriver.com</a>&gt;<br>
          +Date: Mon, 19 Aug 2019 07:16:47 -0400<br>
          +Subject: [PATCH] decreasing the default RLIMIT_NOFILE<br>
          +<br>
          +Since do_testimage for core-image-sato-sdk has memory limits
          (256Mib)<br>
          +which caused rpc.statd failed with out of memory.<br>
          +[  531.306146] Out of memory: Kill process 193 (rpc.statd)
          score 200 or sacrifice child<br>
          +<br>
          +The rpc.statd allocates memory according to RLIMIT_NOFILE,<br>
          +so decrease it to 4k which keep sync with sysvinit<br>
          +<br>
          +Upstream-Status: Inappropriate [oe specific]<br>
          +<br>
          +Signed-off-by: Hongxu Jia &lt;<a href="mailto:hongxu.jia@windriver.com" target="_blank">hongxu.jia@windriver.com</a>&gt;<br>
          +---<br>
          + meson.build | 2 +-<br>
          + 1 file changed, 1 insertion(+), 1 deletion(-)<br>
          +<br>
          +diff --git a/meson.build b/meson.build<br>
          +index 18a7cc5..e30894b 100644<br>
          +--- a/meson.build<br>
          ++++ b/meson.build<br>
          +@@ -79,7 +79,7 @@ conf.set10(&#39;HAVE_SYSV_COMPAT&#39;,
          sysvinit_path != &#39;&#39; and sysvrcnd_path != &#39;&#39;,<br>
          + <br>
          + conf.set10(&#39;BUMP_PROC_SYS_FS_FILE_MAX&#39;,
          get_option(&#39;bump-proc-sys-fs-file-max&#39;))<br>
          + conf.set10(&#39;BUMP_PROC_SYS_FS_NR_OPEN&#39;, 
          get_option(&#39;bump-proc-sys-fs-nr-open&#39;))<br>
          +-conf.set(&#39;HIGH_RLIMIT_NOFILE&#39;,          512*1024)<br>
          ++conf.set(&#39;HIGH_RLIMIT_NOFILE&#39;,          4*1024)<br>
          + <br>
          + # join_paths ignores the preceding arguments if an absolute
          component is<br>
          + # encountered, so this should canonicalize various paths
          when they are<br>
          +-- <br>
          +2.8.1<br>
          +<br>
          diff --git a/meta/recipes-core/systemd/<a href="http://systemd_242.bb" rel="noreferrer" target="_blank">systemd_242.bb</a>
          b/meta/recipes-core/systemd/<a href="http://systemd_242.bb" rel="noreferrer" target="_blank">systemd_242.bb</a><br>
          index 1953fef..ab15ad2 100644<br>
          --- a/meta/recipes-core/systemd/<a href="http://systemd_242.bb" rel="noreferrer" target="_blank">systemd_242.bb</a><br>
          +++ b/meta/recipes-core/systemd/<a href="http://systemd_242.bb" rel="noreferrer" target="_blank">systemd_242.bb</a><br>
          @@ -58,6 +58,10 @@ SRC_URI_MUSL =
          &quot;<a class="gmail-m_-7060366043772446825moz-txt-link-freetext">file://0001-Use-getenv-when-secure-versions-are-not</a>-<a href="http://available.pa" target="_blank">available.pa</a><br>
                         
          <a class="gmail-m_-7060366043772446825moz-txt-link-freetext">file://0001-do-not-disable-buffer-in-writing-files.patch</a> \<br>
                          &quot;<br>
          <br>
          +SRC_URI_append_qemuall = &quot; \<br>
          +             
           <a class="gmail-m_-7060366043772446825moz-txt-link-freetext">file://0001-decreasing-the-default-RLIMIT_NOFILE.patch</a> \<br>
          +&quot;<br>
          +<br>
           PAM_PLUGINS = &quot; \<br>
               pam-plugin-unix \<br>
               pam-plugin-loginuid \<br>
          -- <br>
          2.8.1<br>
          <br>
          -- <br>
          _______________________________________________<br>
          Openembedded-core mailing list<br>
          <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
          <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
        </blockquote>
      </div>
    </blockquote>
    <p><br>
    </p>
  </div>

</blockquote></div>