[PATCH] activation: set children oom_score_adj to 0

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Jun 7 12:10:52 UTC 2016


On 07/06/16 12:53, WaLyong Cho wrote:
> If dbus is running as systemd service, dbus daemon is running with
> oom_score_adj -900 by OOMScoreAdjust=-900. And children will also have
> same value with dbus daemon.
> To avoid this, set the child itself values after fork () to 0.

This looks like it might be intended to be a solution to the same issue
as <https://bugs.freedesktop.org/show_bug.cgi?id=32851>. Please see
Lennart's review comments on that bug: in particular, this should
probably be #ifdef __linux__, and the file descriptor should be marked
close-on-exec. Please attach any revised patches to that bug.

Is there any particular reason to have used buffered stdio here, and not
open() + write()? Buffered I/O seems undesirable when writing to the
/proc pseudo-filesystem.

I would normally suggest using _dbus_string_save_to_file(), but that
uses the tempfile + atomic overwrite pattern, which won't work in /proc.

-- 
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>



More information about the dbus mailing list