Re: [PATCH] activation: set children oom_score_adj to 0

Simon McVittie <simon.mcvittie-ZGY8ohtN/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Collabora Ltd.
Message-ID <[email protected]>
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/>

_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.