public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Daranton <daranton.public@proton.me>
To: git-commits@fedoraproject.org
Subject: [rpms/systemd] f45: oomd-defaults: enable swap-based killing for user app.slice
Date: Tue, 24 Nov 2026 17:55:46 GMT	[thread overview]
Message-ID: <179554294665.1.15524533944471443297.rpms-systemd-e86ba7354575@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/systemd
            Branch : f45
            Commit : e86ba73545754534889a8a57c490066b8fb32186
            Author : Daranton <daranton.public@proton.me>
            Date   : 2026-11-23T21:03:46+00:00
            Stats  : +7/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/systemd/c/e86ba73545754534889a8a57c490066b8fb32186?branch=f45

            Log:
            oomd-defaults: enable swap-based killing for user app.slice

Since 7665e1796f91 removed ManagedOOMSwap=kill from -.slice, no cgroup
is monitored for swap and SwapUsedLimit= is never used. On zram-only
desktops the memory pressure rule often doesn't trigger before the
session becomes unusable (rhbz#2248071, systemd#25596).

The removal was because the root-slice rule could pick GNOME Shell
(rhbz#1941170). Scope the swap rule to the user's app.slice only, so
session.slice and system.slice are never candidates.

---
diff --git a/10-oomd-app-slice-swap-defaults.conf b/10-oomd-app-slice-swap-defaults.conf
new file mode 100644
index 0000000..8e69623
--- /dev/null
+++ b/10-oomd-app-slice-swap-defaults.conf
@@ -0,0 +1,5 @@
+# Kill the app using the most swap when total swap use exceeds
+# SwapUsedLimit= (90% by default). Limited to app.slice so that
+# session.slice (GNOME Shell, etc.) is never a candidate.
+[Slice]
+ManagedOOMSwap=kill

diff --git a/systemd.spec b/systemd.spec
index 5516f50..ff11e29 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -141,6 +141,7 @@ Source24:       sysusers.generate-pre.sh
 Source25:       98-default-mac-none.link
 
 Source26:       systemd-user
+Source27:       10-oomd-app-slice-swap-defaults.conf
 
 %if 0%{?fedora} < 40 && 0%{?rhel} < 10
 # Work-around for dracut issue: run generators directly when we are in initrd
@@ -1191,6 +1192,7 @@ install -Dm0644 %{SOURCE13} %{buildroot}%{_prefix}/lib/systemd/.abignore
 install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/oomd.conf.d/ %{SOURCE14}
 install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15}
 install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15}
+install -Dm0644 -t %{buildroot}%{user_unit_dir}/app.slice.d/ %{SOURCE27}
 %if 0%{?fedora}
 # https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
 install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16}

                 reply	other threads:[~2026-11-24 17:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179554294665.1.15524533944471443297.rpms-systemd-e86ba7354575@fedoraproject.org \
    --to=daranton.public@proton.me \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox