Ubuntu Developers Have an Idea to Handle Excessive Removal of Systemd OOMD App

With the recent Ubuntu 22.04 LTS release, they ship systemd-oomd by default to their desktop to try and better handle out of memory / out of memory situations. However, in the real world, systemd-oomd too easily kills user-space applications such as Firefox and Chrome when approaching memory pressure. This is a bad Ubuntu 22.04 user experience, but the developers now have an idea of ​​their approach to addressing this solution.

Systemd-oomd on Ubuntu 22.04 LTS too easily kills user applications such as web browsers and other memory-intensive but user-critical applications. This killing of applications under memory pressure is often done without the user being aware of what is happening or without notice.

They discussed changing their systemd-oomd settings, even possibly changing Ubuntu’s default swap size, and other changes. Based on the latest mailing list posts and Canonical engineering activity, they want an upstream change to systemd and then changes to key desktop components so they can properly communicate that their OOM removal needs to be avoided.

Systemd already has a “ManagedOOMPreference” parameter that service files can use where one of the supported values ​​is “avoid” if the out of memory preference is to try to avoid killing the cgroup of the unit when systemd-oomd is determining how to reduce memory consumption. Avoided services will only be killed if no other viable candidates for the kill are available (or there is also “omit” where under no circumstances would OOMD kill that unit’s control group). But the current problem is that the ManagedOOMPreference is only honored for cgroups owned by root, which is not the case in the desktop domain.

Canonical’s Nick Rosbrook opened a preview pull request to upstream systemd which would allow ManagedOOMPreference to work for all cgroups, but not root owned ones. Systemd upstream doesn’t object and there was even a similar idea last year which had not been merged to allow the user to control this preference.

So it looks like this change could go upstream and Ubuntu 22.04 LTS could then backport the change. User service files can then set ManagedOOMPreference to omit or avoid, as needed. However, this would not be good for applications launched by GNOME Shell or Snapd. Further work would therefore be required to integrate ManagedOOMPreference handling into GNOME Shell to pass the preference to selected apps on launch. This is also to determine any services/applications to set for the ManagedOOMPreference=avoid behavior.

At least from ubuntu-devel thread this seems to be their preferred way to tame Ubuntu’s systemd-oomd so as not to kill major userspace/desktop applications. It will still take some time for the change to be implemented upstream and for a better integration of the office to occur.


Source link

Steven L. Nielsen