<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>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;file://0001-Use-getenv-when-secure-versions-are-not-<a href="http://available.pa" target="_blank">available.pa</a><br>
                file://0001-do-not-disable-buffer-in-writing-files.patch \<br>
                &quot;<br>
<br>
+SRC_URI_append_qemuall = &quot; \<br>
+               file://0001-decreasing-the-default-RLIMIT_NOFILE.patch \<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>