systemd-oomd issues on desktop
Nick Rosbrook
nick.rosbrook at canonical.com
Mon Jun 13 23:22:19 UTC 2022
On Mon, Jun 13, 2022 at 8:19 AM Lukas Märdian <slyon at ubuntu.com> wrote:
> I wonder if we could use a more selective approach, though, using
> "OOMScoreAdjust=" in the systemd.exec environment (i.e. Gnome-Shell
> launcher in Ubuntu's context, as sd-oomd is currently only enabled on
> Ubuntu Desktop) [2], to reduce the probability of certain "important"
> apps being killed first, e.g. by maintaining an allow-list of such apps.
IIUC, OOMScoreAdjust only influences the behavior of the kernel OOM
killer, not systemd-oomd. In any case, I do agree that a "selective
approach" might improve the current situation (this is what I tried to
convey in option (2)).
The ManagedOOMPreference[1] option exists, but this property is
ignored if the unit's cgroup is not owned by root. The rationale for
the limitation is described in a link that Michel shared [2]. In
short, this option is reserved for "critical services" and should be
used sparingly. But, as Steve said earlier, it is likely that the
browser is the most important process to many desktop users. Maybe
this limitation on setting ManagedOOMPreference could be removed, or
eased to at least allow setting `ManagedOOMPreference=avoid` on
non-root owned cgroups? For this to be effective, there would need to
be other viable kill candidates (i.e. cgroups with greater than 5%
swap usage) when the SwapUsedLimit is met.
Thanks,
Nick
[1] https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#ManagedOOMPreference=none%7Cavoid%7Comit
[2] https://fedoraproject.org/wiki/Changes/EnableSystemdOomd#Can_we_exclude_certain_units_from_being_killed.3F
More information about the ubuntu-devel
mailing list