1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

14 Commits

Author SHA1 Message Date
Frantisek Sumsal
084575ff91 test: use set -eux and set -o pipefail everywhere
This should make the scripts more robust.
2021-04-13 12:08:01 +02:00
Zbigniew Jędrzejewski-Szmek
0ee994836c TEST-*: use spacing before redirection operator, but not after
<< EOF → <<EOF
> foo < bar → >foo <bar
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
4e20fe2795 TEST-*: make failure tests actually fail on failure
Here the intent was actually correct, and the tests still pass when the check
is made effective.
2021-04-08 20:21:50 +02:00
Henri Chain
cb0e818f7c Introduce ExitType 2021-03-31 10:26:07 +02:00
Yu Watanabe
1ebcf47296 test: merge udev tests 2021-03-05 18:36:04 +09:00
Luca Boccassi
04153c4509 test: skip TEST-56-OOMD if systemd-oomd is not installed
Fixes #18775
2021-02-24 15:02:07 +01:00
Anita Zhang
4e806bfa9f oom: add unit file settings for oomd avoid/omit xattrs 2021-02-12 12:45:36 -08:00
Anita Zhang
59331b8e29 oom: implement avoid/omit xattr support
There may be situations where a cgroup should be protected from killing
or deprioritized as a candidate. In FB oomd xattrs are used to bias oomd
away from supervisor cgroups and towards worker cgroups in container
tasks. On desktops this can be used to protect important units with
unpredictable resource consumption.

The patch allows systemd-oomd to understand 2 xattrs:
"user.oomd_avoid" and "user.oomd_omit". If systemd-oomd sees these
xattrs set to 1 on a candidate cgroup (i.e. while attempting to kill something)
AND the cgroup is owned by root, it will either deprioritize the cgroup as
a candidate (avoid) or remove it completely as a candidate (omit).

Usage is restricted to root owned cgroups to prevent situations where an
unprivileged user can set their own cgroups lower in the kill priority than
another user's (and prevent them from omitting their units from
systemd-oomd killing).
2021-02-09 02:27:40 -08:00
Anita Zhang
0a9f93443b oom: rework *MemoryPressureLimit= properties to have 1/10000 precision
Requested in
https://github.com/systemd/systemd/pull/15206#discussion_r505506657,
preserve the full granularity for memory pressure limits (permyriad)
instead of capping out at percent.
2021-02-02 17:52:48 -08:00
Anita Zhang
2e744a2cd8 oom: update extended test to remove swap gating 2021-01-24 02:03:59 -08:00
Anita Zhang
c20aa7b171 oom: make memory pressure duration configurable through oomd.conf 2021-01-24 01:59:03 -08:00
Anita Zhang
14d044da23 test: fix TEST-56-OOMD thresholds for linux 5.9 changes
Fixes #17533

The memory pressure values of the units in TEST-56-OOMD seemed to be a
lot lower after updating to linux 5.9. This is likely due to a fix from
e22c6ed90a.

To account for this, I lowered memory.high on testbloat.service to
throttle it even more. This was enough to generate the 50%+ value to trigger
oomd for the test, but as an extra precaution I also lowered the oomd
threshold to 1% so it's certain to try and kill testbloat.service.
2020-12-02 15:27:15 -08:00
Anita Zhang
311e3d4637 test: make TEST-56-OOMD service unit files static 2020-10-23 15:59:00 -07:00
Anita Zhang
e4ff80404a test: add basic memory pressure extended test for oomd
Simple test to generate a lot of pressure in one unit and assert that
systemd-oomd kills the right one.
2020-10-22 17:04:22 -07:00