cgroup: Add ManagedOOMMemoryPressureDurationSec= override setting for units
authorRyan Wilson <ryantimwilson@meta.com>
Tue, 15 Oct 2024 03:49:54 +0000 (20:49 -0700)
committerRyan Wilson <ryantimwilson@meta.com>
Thu, 17 Oct 2024 03:12:38 +0000 (20:12 -0700)
commit63d4c4271ca529f8357a84cbc075170fffdb3de8
treee8a1c9c0dfe0bd0ecc76daabaa7b8352747952b1
parentc43ef2e8836a497cedc3a06e6f0aebe484bf688a
cgroup: Add ManagedOOMMemoryPressureDurationSec= override setting for units

This will allow units (scopes/slices/services) to override the default
systemd-oomd setting DefaultMemoryPressureDurationSec=.

The semantics of ManagedOOMMemoryPressureDurationSec= are:
- If >= 1 second, overrides DefaultMemoryPressureDurationSec= from oomd.conf
- If is empty, uses DefaultMemoryPressureDurationSec= from oomd.conf
- Ignored if ManagedOOMMemoryPressure= is not "kill"
- Disallowed if < 1 second

Note the corresponding dbus property is DefaultMemoryPressureDurationUSec
which is in microseconds. This is consistent with other time-based
dbus properties.
21 files changed:
docs/TRANSIENT-SETTINGS.md
man/oomd.conf.xml
man/org.freedesktop.systemd1.xml
man/systemd.resource-control.xml
src/core/cgroup.c
src/core/cgroup.h
src/core/core-varlink.c
src/core/dbus-cgroup.c
src/core/execute-serialize.c
src/core/load-fragment-gperf.gperf.in
src/core/load-fragment.c
src/core/load-fragment.h
src/oom/oomd-manager.c
src/oom/oomd-util.c
src/oom/oomd-util.h
src/oom/test-oomd-util.c
src/shared/bus-print-properties.c
src/shared/bus-unit-util.c
src/shared/varlink-io.systemd.oom.c
test/fuzz/fuzz-unit-file/directives-all.service
test/units/TEST-55-OOMD.sh