summaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorRyan Wilson <ryantimwilson@meta.com>2024-10-15 05:49:54 +0200
committerRyan Wilson <ryantimwilson@meta.com>2024-10-17 05:12:38 +0200
commit63d4c4271ca529f8357a84cbc075170fffdb3de8 (patch)
treee8a1c9c0dfe0bd0ecc76daabaa7b8352747952b1 /man
parentoomd: Refactor DefaultMemoryPressureDurationSec= to use conf parser (diff)
downloadsystemd-63d4c4271ca529f8357a84cbc075170fffdb3de8.tar.xz
systemd-63d4c4271ca529f8357a84cbc075170fffdb3de8.zip
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.
Diffstat (limited to 'man')
-rw-r--r--man/oomd.conf.xml3
-rw-r--r--man/org.freedesktop.systemd1.xml42
-rw-r--r--man/systemd.resource-control.xml23
3 files changed, 65 insertions, 3 deletions
diff --git a/man/oomd.conf.xml b/man/oomd.conf.xml
index 582fb27de1..13f1f22e53 100644
--- a/man/oomd.conf.xml
+++ b/man/oomd.conf.xml
@@ -90,7 +90,8 @@
<term><varname>DefaultMemoryPressureDurationSec=</varname></term>
<listitem><para>Sets the amount of time a unit's control group needs to have exceeded memory pressure
- limits before <command>systemd-oomd</command> will take action. Memory pressure limits are defined by
+ limits before <command>systemd-oomd</command> will take action. A unit can override this value with
+ <varname>ManagedOOMMemoryPressureDurationSec=</varname>. Memory pressure limits are defined by
<varname>DefaultMemoryPressureLimit=</varname> and <varname>ManagedOOMMemoryPressureLimit=</varname>.
Must be set to 0, or at least 1 second. Defaults to 30 seconds when unset or 0.</para>
diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml
index 1e34ddbc85..25905de8c8 100644
--- a/man/org.freedesktop.systemd1.xml
+++ b/man/org.freedesktop.systemd1.xml
@@ -2993,6 +2993,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -4312,6 +4314,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -4849,6 +4853,11 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
method. See <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for more details on how to retrieve these file descriptors. Unlike the <varname>ExtraFileDescriptors</varname>
input property, <varname>ExtraFileDescriptorNames</varname> only contains names and not the file descriptors.</para>
+
+ <para><varname>ManagedOOMMemoryPressureDurationUSec</varname> implement the destination parameter of the
+ unit file setting <varname>ManagedOOMMemoryPressureDurationSec=</varname> listed in
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ Note the time unit is expressed in <literal>μs</literal>.</para>
</refsect2>
</refsect1>
@@ -5148,6 +5157,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -6451,6 +6462,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -7145,6 +7158,8 @@ node /org/freedesktop/systemd1/unit/home_2emount {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -8286,6 +8301,8 @@ node /org/freedesktop/systemd1/unit/home_2emount {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -9109,6 +9126,8 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -10222,6 +10241,8 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -10898,6 +10919,8 @@ node /org/freedesktop/systemd1/unit/system_2eslice {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -11285,6 +11308,8 @@ node /org/freedesktop/systemd1/unit/system_2eslice {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -11309,6 +11334,11 @@ node /org/freedesktop/systemd1/unit/system_2eslice {
<title>Properties</title>
<para>Most properties correspond directly with the matching settings in slice unit files.</para>
+
+ <para><varname>ManagedOOMMemoryPressureDurationUSec</varname> implement the destination parameter of the
+ unit file setting <varname>ManagedOOMMemoryPressureDurationSec=</varname> listed in
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ Note the time unit is expressed in <literal>μs</literal>.</para>
</refsect2>
</refsect1>
@@ -11507,6 +11537,8 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope {
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly u ManagedOOMMemoryPressureLimit = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
+ readonly t ManagedOOMMemoryPressureDurationUSec = ...;
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly s ManagedOOMPreference = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly a(ss) BPFProgram = [...];
@@ -11944,6 +11976,8 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope {
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureLimit"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMMemoryPressureDurationUSec"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="ManagedOOMPreference"/>
<variablelist class="dbus-property" generated="True" extra-ref="BPFProgram"/>
@@ -12004,6 +12038,11 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope {
the scope unit is to be shut down via a <function>RequestStop()</function> signal (see below). This is
set when the scope is created. If not set, the scope's processes will terminated with
<constant>SIGTERM</constant> directly.</para>
+
+ <para><varname>ManagedOOMMemoryPressureDurationUSec</varname> implement the destination parameter of the
+ unit file setting <varname>ManagedOOMMemoryPressureDurationSec=</varname> listed in
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ Note the time unit is expressed in <literal>μs</literal>.</para>
</refsect2>
</refsect1>
@@ -12222,6 +12261,7 @@ $ gdbus introspect --system --dest org.freedesktop.systemd1 \
<varname>PrivateTmpEx</varname>,
<varname>ImportCredentialEx</varname>,
<varname>ExtraFileDescriptorNames</varname>,
+ <varname>ManagedOOMMemoryPressureDurationUSec</varname>,
<varname>BindLogSockets</varname>, and
<varname>PrivateUsersEx</varname> were added in version 257.</para>
</refsect2>
@@ -12362,6 +12402,7 @@ $ gdbus introspect --system --dest org.freedesktop.systemd1 \
<varname>EffectiveMemoryMax</varname>,
<varname>EffectiveTasksMax</varname>, and
<varname>MemoryZSwapWriteback</varname> were added in version 256.</para>
+ <para><varname>ManagedOOMMemoryPressureDurationUSec</varname> was added in version 257.</para>
</refsect2>
<refsect2>
<title>Scope Unit Objects</title>
@@ -12387,6 +12428,7 @@ $ gdbus introspect --system --dest org.freedesktop.systemd1 \
<varname>EffectiveMemoryMax</varname>,
<varname>EffectiveTasksMax</varname>, and
<varname>MemoryZSwapWriteback</varname> were added in version 256.</para>
+ <para><varname>ManagedOOMMemoryPressureDurationUSec</varname> was added in version 257.</para>
</refsect2>
<refsect2>
<title>Job Objects</title>
diff --git a/man/systemd.resource-control.xml b/man/systemd.resource-control.xml
index 2ffc279a35..1f16052a33 100644
--- a/man/systemd.resource-control.xml
+++ b/man/systemd.resource-control.xml
@@ -1535,10 +1535,10 @@ DeviceAllow=/dev/loop-control
<listitem>
<para>Overrides the default memory pressure limit set by
<citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
- this unit (cgroup). Takes a percentage value between 0% and 100%, inclusive. This property is
- ignored unless <varname>ManagedOOMMemoryPressure=</varname><option>kill</option>. Defaults to 0%,
+ the cgroup of this unit. Takes a percentage value between 0% and 100%, inclusive. Defaults to 0%,
which means to use the default set by
<citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ This property is ignored unless <varname>ManagedOOMMemoryPressure=</varname><option>kill</option>.
</para>
<xi:include href="version-info.xml" xpointer="v247"/>
@@ -1546,6 +1546,25 @@ DeviceAllow=/dev/loop-control
</varlistentry>
<varlistentry>
+ <term><varname>ManagedOOMMemoryPressureDurationSec=</varname></term>
+
+ <listitem>
+ <para>Overrides the default memory pressure duration set by
+ <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
+ the cgroup of this unit. The specified value supports a time unit such as <literal>ms</literal> or
+ <literal>μs</literal>, see
+ <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+ for details on the permitted syntax. Must be set to either empty or a value of at least 1s. Defaults
+ to empty, which means to use the default set by
+ <citerefentry><refentrytitle>oomd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ This property is ignored unless <varname>ManagedOOMMemoryPressure=</varname><option>kill</option>.
+ </para>
+
+ <xi:include href="version-info.xml" xpointer="v257"/>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>ManagedOOMPreference=none|avoid|omit</varname></term>
<listitem>