From Fedora Project Wiki

Revision as of 10:59, 11 March 2021 by Anitazha (talk | contribs) (Created page with "{{QA/Test_Case |description=This test case tests that systemd-oomd will kill a cgroup with the most pgscans when memory pressure on user@$UID.service exceeds 10% (or whatever...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This test case tests that systemd-oomd will kill a cgroup with the most pgscans when memory pressure on user@$UID.service exceeds 10% (or whatever was defined in systemd-oomd-defaults).

Setup

  1. This test case should be performed on either bare-metal or virtual machines.
  2. Check that you are running systemd 248~rc1 or higher with systemctl --version.
  3. Ensure the systemd-oomd-defaults package is installed (included with Fedora 34).
  4. Boot the system and log in as a regular user.
  5. So as not to trigger the swap policy for systemd-oomd, create an override with the following commands (remove this file and systemctl daemon-reload to restore the settings):
sudo printf "[Slice]/nManagedOOMSwap=auto" > /etc/systemd/system/-.slice.d/99-test.conf
sudo systemctl daemon-reload

How to test

  1. Check that systemd-oomd is running:
systemctl status systemd-oomd
  1. Check that the systemd-oomd-defaults policy was applied by running oomctl and verifying that "/" is listed as a path under "Swap Monitored CGroups" along with the current swap usage.
  2. Now run the test:
systemd-run --user tail /dev/zero

Expected Results

  1. systemd-oomd will have killed the unit started above. You can verify by checking for log lines that say something about "swap used <...> is more than 90%" and "systemd-oomd killed <...> process(es)" with journalctl.
  2. Swap used should be below 90% (use free -h)