diff options
author | Khang Nguyen <khang.nguyen.xv@rvc.renesas.com> | 2018-03-07 10:33:27 +0700 |
---|---|---|
committer | Khang Nguyen <khang.nguyen.xv@rvc.renesas.com> | 2018-03-22 13:36:54 +0700 |
commit | 8b9882947cf6e9508eacdf543bd88a07d88f6598 (patch) | |
tree | 393f858dd3a01b7b62513b5a975acaf1dbea2376 /meta-rcar-gen3/recipes-core | |
parent | 4fcaa8e59e35cecb3d80a9bdaa9f0cd8c164fb0c (diff) |
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 <khang.nguyen.xv@rvc.renesas.com>
Signed-off-by: Takamitsu Honda <takamitsu.honda.pv@renesas.com>
Diffstat (limited to 'meta-rcar-gen3/recipes-core')
-rw-r--r-- | meta-rcar-gen3/recipes-core/systemd/systemd_%.bbappend | 10 |
1 files changed, 10 insertions, 0 deletions
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 +} |