From 8b9882947cf6e9508eacdf543bd88a07d88f6598 Mon Sep 17 00:00:00 2001 From: Khang Nguyen Date: Wed, 7 Mar 2018 10:33:27 +0700 Subject: rcar-gen3: systemd: Do not save file descriptors when restarting Weston In systemd v234, systemd-logind may now be restarted without losing state, it stores the file descriptors (fd) for devices it manages in the system manager. [1] In graphic and multimedia configuration, above feature causes memory leak with the use case of restarting Weston: | root@salvator-x:~# cat /proc/meminfo | grep Cma | CmaTotal: 671744 kB | CmaFree: 629788 kB | root@salvator-x:~# | root@salvator-x:~# systemctl restart weston | root@salvator-x:~# | root@salvator-x:~# cat /proc/meminfo | grep Cma | CmaTotal: 671744 kB | CmaFree: 599404 kB Because the system continues allocating memory for the new session during the previous device fds still open. This commit avoids saving device fds into the system manager by setting "FileDescriptorStoreMax=0" [2] in "systemd-logind.service". [1] https://lists.freedesktop.org/archives/systemd-devel/2017-July/039308.html [2] https://www.freedesktop.org/software/systemd/man/systemd.service.html#FileDescriptorStoreMax= Signed-off-by: Khang Nguyen Signed-off-by: Takamitsu Honda --- meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'meta-rcar-gen3/recipes-core/systemd') diff --git a/meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend b/meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend index f414a2b..99f8e7c 100644 --- a/meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend +++ b/meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend @@ -1 +1,11 @@ +require include/gles-control.inc + PACKAGECONFIG_remove = "timesyncd" + +# Avoid pushing opened device fds into PID1 by logind when restarting +do_install_append () { + if [ "X${USE_GLES}" = "X1" ]; then + sed -e 's/FileDescriptorStoreMax=512/FileDescriptorStoreMax=0/' \ + -i ${D}/lib/systemd/system/systemd-logind.service + fi +} -- cgit 1.2.3-korg