From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) by mail.openembedded.org (Postfix) with ESMTP id 6DF5C7F1BA for ; Mon, 19 Aug 2019 14:42:01 +0000 (UTC) Received: by mail-vs1-f52.google.com with SMTP id q188so1330379vsa.4 for ; Mon, 19 Aug 2019 07:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SwY6UIATVZwa6dsW1wgHea72jQ8xlvvsQfuKgVIklTw=; b=WKMcqFHuYNmsmfUoC8KsRsQ7qMa9XO8I2EZE15lbCeTzyHC4LcAULShn9Uwym2XEJF SdLEzopTbj5IU1L4THglkVkpQpKmDR4Xl5QhFerYymqk6fHvDVhBKx6ug4hccGSw1Vyh Mbh0YfpHuU0plvM7UH5VOrd4Mw6CXuWmv6xp30qPGDf2cPhAYdI0wAYbBveyIbVJw0s1 Muuig6fEQnBu0p9Wag6/6ijdIFt+gHEkPDPff80uKUd48BoVsZGp5kOmumBHoxeTJ7TO BmdTtZYJ26s2nZJHzBVDYBFWp6p2dIu6qD5q07s3NImgU/3uTy3e9laeVWZe1xTAtG8N q6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SwY6UIATVZwa6dsW1wgHea72jQ8xlvvsQfuKgVIklTw=; b=V/6PUU/dUHDIRVMw/9zwLKQuGqLS9QYLq883Lw1zVznfRIbAb770+7gzls3T9yRC8K P5hn0/te9RqaBDD8dFAvi7V+Tioq0LNd895JSZOkmspsjvMV3+futQ8SobvSzQKefG1+ gqHfqmcWYMM12XuuJ6+adyo/V7BFN5G2Z25NdWOYZXT+zM8QNNGq3et1alK585MpJlfY E7g/Mfrc/NulcjCOyLKN/gTI8M9WempDVWUYMGhfj4ZApSxYM4m6DRXmbDm0aXoglCX0 pwiDgZRPNRgToXc2ouAzkV8rInof1Q7yShdKwGUoZ0z5W3VP7VBEAzUKhLHzP2ZXy8W0 2sow== X-Gm-Message-State: APjAAAXwglcPAOlC5YhDkSUQvei9hs5VUuoFDBZMLpEOc7jHSPfiYi1P QAWe6o/D8wSgXeYayT7rVE6AiSyYvSsf4bqnZ6o= X-Google-Smtp-Source: APXvYqzOMQc5f4IbfI52JtCmfDBRcRU88gDTuFwerxUVsNJLVZQvKaMsXi5Q8hypUg4Tz8F8xYj1Ymtphl+3Wu6fl40= X-Received: by 2002:a67:1c87:: with SMTP id c129mr1064750vsc.23.1566225722256; Mon, 19 Aug 2019 07:42:02 -0700 (PDT) MIME-Version: 1.0 References: <1566221602-123706-1-git-send-email-hongxu.jia@windriver.com> <0ff6e267-1659-ea55-cfc9-ce07da934511@windriver.com> In-Reply-To: <0ff6e267-1659-ea55-cfc9-ce07da934511@windriver.com> From: Alexander Kanavin Date: Mon, 19 Aug 2019 16:41:51 +0200 Message-ID: To: Hongxu Jia Cc: OE-core Subject: Re: [PATCH] systemd: decreasing default RLIMIT_NOFILE on qemu bsp X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 14:42:01 -0000 Content-Type: multipart/alternative; boundary="000000000000d0392f059079579a" --000000000000d0392f059079579a Content-Type: text/plain; charset="UTF-8" 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. Alex On Mon, 19 Aug 2019 at 16:25, Hongxu Jia wrote: > On 8/19/19 10:01 PM, Alexander Kanavin wrote: > > 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't the right thing to do, I think. > > The modification of set default RLIMIT_NOFILE(4k) just keeps sync with the > one in sysvinit, > > if the fronts you mentioned are working fine on sysvinit, I think it > should be OK on systemd > > but whether it has side effect or not still depends on the result of image > test > > > The fix is trying to fix the blocking issue while switching init manager > from sysvinit to systemd for poky > > > Hi RP, > > Should we make HIGH_RLIMIT_NOFILE configurable from local.conf? > > Then we could modify it according to the requirement, such as set it to 4k > at image test > > //Hongxu > > > Alex > > On Mon, 19 Aug 2019 at 15:34, Hongxu Jia wrote: > >> Since do_testimage for core-image-sato-sdk has memory limitation (256Mib) >> which caused rpc.statd failed with out of memory. >> [ 531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or >> sacrifice child >> >> The rpc.statd allocates memory according to RLIMIT_NOFILE, >> so decrease it to 4k to keep sync with sysvinit >> >> After applying the patch, the memory cost is the same with sysvinit >> rpcuser 340 0.0 1.0 3212 2588 ? Ss 13:20 0:00 >> /usr/sbin/rpc.statd -F >> root 473 0.0 0.2 3464 496 ? Ss 13:23 0:00 >> /usr/sbin/rpc.mountd >> >> Signed-off-by: Hongxu Jia >> --- >> ...0001-decreasing-the-default-RLIMIT_NOFILE.patch | 35 >> ++++++++++++++++++++++ >> meta/recipes-core/systemd/systemd_242.bb | 4 +++ >> 2 files changed, 39 insertions(+) >> create mode 100644 >> meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch >> >> 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 >> new file mode 100644 >> index 0000000..fb8e2c9 >> --- /dev/null >> +++ >> b/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE.patch >> @@ -0,0 +1,35 @@ >> +From 55c7196163e481c508fa708b9b8f5e7bf2d2f007 Mon Sep 17 00:00:00 2001 >> +From: Hongxu Jia >> +Date: Mon, 19 Aug 2019 07:16:47 -0400 >> +Subject: [PATCH] decreasing the default RLIMIT_NOFILE >> + >> +Since do_testimage for core-image-sato-sdk has memory limits (256Mib) >> +which caused rpc.statd failed with out of memory. >> +[ 531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or >> sacrifice child >> + >> +The rpc.statd allocates memory according to RLIMIT_NOFILE, >> +so decrease it to 4k which keep sync with sysvinit >> + >> +Upstream-Status: Inappropriate [oe specific] >> + >> +Signed-off-by: Hongxu Jia >> +--- >> + meson.build | 2 +- >> + 1 file changed, 1 insertion(+), 1 deletion(-) >> + >> +diff --git a/meson.build b/meson.build >> +index 18a7cc5..e30894b 100644 >> +--- a/meson.build >> ++++ b/meson.build >> +@@ -79,7 +79,7 @@ conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and >> sysvrcnd_path != '', >> + >> + conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', >> get_option('bump-proc-sys-fs-file-max')) >> + conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', >> get_option('bump-proc-sys-fs-nr-open')) >> +-conf.set('HIGH_RLIMIT_NOFILE', 512*1024) >> ++conf.set('HIGH_RLIMIT_NOFILE', 4*1024) >> + >> + # join_paths ignores the preceding arguments if an absolute component is >> + # encountered, so this should canonicalize various paths when they are >> +-- >> +2.8.1 >> + >> diff --git a/meta/recipes-core/systemd/systemd_242.bb >> b/meta/recipes-core/systemd/systemd_242.bb >> index 1953fef..ab15ad2 100644 >> --- a/meta/recipes-core/systemd/systemd_242.bb >> +++ b/meta/recipes-core/systemd/systemd_242.bb >> @@ -58,6 +58,10 @@ SRC_URI_MUSL = " >> file://0001-Use-getenv-when-secure-versions-are-not-available.pa >> file://0001-do-not-disable-buffer-in-writing-files.patch >> \ >> " >> >> +SRC_URI_append_qemuall = " \ >> + file://0001-decreasing-the-default-RLIMIT_NOFILE.patch \ >> +" >> + >> PAM_PLUGINS = " \ >> pam-plugin-unix \ >> pam-plugin-loginuid \ >> -- >> 2.8.1 >> >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> > > --000000000000d0392f059079579a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Probably in this case it is better to add a patch tha= t allows HIGH_RLIMIT_NOFILE to be configured from the systemd recipe via me= son switches, and offer that to systemd upstream.

= Alex

On Mon, 19 Aug 2019 at 16:25, Hongxu Jia <hongxu.jia@windriver.com> wrote:
=20 =20 =20
On 8/19/19 1= 0:01 PM, Alexander Kanavin wrote:
=20
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't the right thing to do, I think.

The modification of set default RLIMIT_NOFILE(4k) just keeps sync with the one in sysvinit,

if the fronts you mentioned are working fine on sysvinit, I think it should be OK on systemd

but whether it has side effect or not still depends on the result of image test


The fix is trying to fix the blocking issue while switching init manager from sysvinit to systemd for poky


Hi RP,

Should we make HIGH_RLIMIT_NOFILE configurable from local.conf?

Then we could modify it according to the requirement, such as set it to 4k at image test

//Hongxu


Alex

On Mon, 19 Aug 2019 at 15:34, Hongxu Jia <hongxu.jia@windriver.com> wrote:
Since do_testimage for core-image-sato-sdk has memory limitation (256Mib)
which caused rpc.statd failed with out of memory.
[=C2=A0 531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or sacrifice child

The rpc.statd allocates memory according to RLIMIT_NOFILE,
so decrease it to 4k to keep sync with sysvinit

After applying the patch, the memory cost is the same with sysvinit
rpcuser=C2=A0 =C2=A0 340=C2=A0 0.0=C2=A0 1.0=C2=A0 =C2=A03212=C2= =A0 2588 ?=C2=A0 =C2=A0 =C2=A0 =C2=A0 Ss=C2=A0 =C2=A013:20=C2=A0 =C2=A00:00 /usr/sbin/rpc.statd -F
root=C2=A0 =C2=A0 =C2=A0 =C2=A0473=C2=A0 0.0=C2=A0 0.2=C2=A0 =C2= =A03464=C2=A0 =C2=A0496 ?=C2=A0 =C2=A0 =C2=A0 =C2=A0 Ss=C2=A0 =C2=A013:23= =C2=A0 =C2=A00:00 /usr/sbin/rpc.mountd

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
=C2=A0...0001-decreasing-the-default-RLIMIT_NOFILE.patch | 35 ++++++++++++++++++++++
=C2=A0meta/recipes-core/systemd/systemd_242.bb=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 4 +++
=C2=A02 files changed, 39 insertions(+)
=C2=A0create mode 100644 meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFILE= .patch

diff --git a/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFI= LE.patch b/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFI= LE.patch
new file mode 100644
index 0000000..fb8e2c9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-decreasing-the-default-RLIMIT_NOFI= LE.patch
@@ -0,0 +1,35 @@
+From 55c7196163e481c508fa708b9b8f5e7bf2d2f007 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 19 Aug 2019 07:16:47 -0400
+Subject: [PATCH] decreasing the default RLIMIT_NOFILE
+
+Since do_testimage for core-image-sato-sdk has memory limits (256Mib)
+which caused rpc.statd failed with out of memory.
+[=C2=A0 531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or sacrifice child
+
+The rpc.statd allocates memory according to RLIMIT_NOFILE,
+so decrease it to 4k which keep sync with sysvinit
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 18a7cc5..e30894b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -79,7 +79,7 @@ conf.set10('HAVE_SYSV_COMPAT', sysvinit_path !=3D '' and sysvrcnd_path !=3D '',<= br> +
+ conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
+ conf.set10('BUMP_PROC_SYS_FS_NR_OPEN',=C2=A0 get_option('bump-proc-sys-fs-nr-open'))
+-conf.set('HIGH_RLIMIT_NOFILE',=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 512*1024)
++conf.set('HIGH_RLIMIT_NOFILE',=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 4*1024)
+
+ # join_paths ignores the preceding arguments if an absolute component is
+ # encountered, so this should canonicalize various paths when they are
+--
+2.8.1
+
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb
index 1953fef..ab15ad2 100644
--- a/meta/recipes-core/systemd/systemd_242.bb
+++ b/meta/recipes-core/systemd/systemd_242.bb
@@ -58,6 +58,10 @@ SRC_URI_MUSL =3D "file://0001-Use-getenv-when-secure-versions-are-not-available.pa
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi= le://0001-do-not-disable-buffer-in-writing-files.patch \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "
+SRC_URI_append_qemuall =3D " \
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://0001-decreasing-the-default-RLIMIT_NOFILE.patch \
+"
+
=C2=A0PAM_PLUGINS =3D " \
=C2=A0 =C2=A0 =C2=A0pam-plugin-unix \
=C2=A0 =C2=A0 =C2=A0pam-plugin-loginuid \
--
2.8.1

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.= org/mailman/listinfo/openembedded-core


--000000000000d0392f059079579a--