diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-02-15 19:00:14 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-01 09:43:23 +0100 |
commit | 6bb0084204bd93122c9f04391b80aea5a8a0ff08 (patch) | |
tree | 8ebb30a96e430e6bdbc52664d0a2626c85265c04 /man | |
parent | 29e6b0c171f49edb05e017a80bc90a61dfe82de0 (diff) | |
download | systemd-6bb0084204bd93122c9f04391b80aea5a8a0ff08.tar.gz |
pid1: add unit file settings to control memory pressure logic
Diffstat (limited to 'man')
-rw-r--r-- | man/org.freedesktop.systemd1.xml | 84 | ||||
-rw-r--r-- | man/systemd-system.conf.xml | 12 | ||||
-rw-r--r-- | man/systemd.exec.xml | 10 | ||||
-rw-r--r-- | man/systemd.resource-control.xml | 47 |
4 files changed, 153 insertions, 0 deletions
diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index 3f19d2f56a..141fde05b4 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -529,6 +529,10 @@ node /org/freedesktop/systemd1 { readonly t DefaultLimitRTTIMESoft = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly t DefaultTasksMax = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t DefaultMemoryPressureThresholdUSec = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s DefaultMemoryPressureWatch = '...'; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly t TimerSlackNSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -782,6 +786,10 @@ node /org/freedesktop/systemd1 { <!--property DefaultTasksMax is not documented!--> + <!--property DefaultMemoryPressureThresholdUSec is not documented!--> + + <!--property DefaultMemoryPressureWatch is not documented!--> + <!--property TimerSlackNSec is not documented!--> <!--property DefaultOOMPolicy is not documented!--> @@ -1208,6 +1216,10 @@ node /org/freedesktop/systemd1 { <variablelist class="dbus-property" generated="True" extra-ref="DefaultTasksMax"/> + <variablelist class="dbus-property" generated="True" extra-ref="DefaultMemoryPressureThresholdUSec"/> + + <variablelist class="dbus-property" generated="True" extra-ref="DefaultMemoryPressureWatch"/> + <variablelist class="dbus-property" generated="True" extra-ref="TimerSlackNSec"/> <variablelist class="dbus-property" generated="True" extra-ref="DefaultOOMPolicy"/> @@ -2803,6 +2815,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly as Environment = ['...', ...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -3395,6 +3411,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--property EnvironmentFiles is not documented!--> <!--property PassEnvironment is not documented!--> @@ -3995,6 +4015,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <variablelist class="dbus-property" generated="True" extra-ref="Environment"/> <variablelist class="dbus-property" generated="True" extra-ref="EnvironmentFiles"/> @@ -4747,6 +4771,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly as Environment = ['...', ...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -5359,6 +5387,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--property EnvironmentFiles is not documented!--> <!--property PassEnvironment is not documented!--> @@ -5949,6 +5981,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2esocket { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <variablelist class="dbus-property" generated="True" extra-ref="Environment"/> <variablelist class="dbus-property" generated="True" extra-ref="EnvironmentFiles"/> @@ -6590,6 +6626,10 @@ node /org/freedesktop/systemd1/unit/home_2emount { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly as Environment = ['...', ...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -7130,6 +7170,10 @@ node /org/freedesktop/systemd1/unit/home_2emount { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--property EnvironmentFiles is not documented!--> <!--property PassEnvironment is not documented!--> @@ -7638,6 +7682,10 @@ node /org/freedesktop/systemd1/unit/home_2emount { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <variablelist class="dbus-property" generated="True" extra-ref="Environment"/> <variablelist class="dbus-property" generated="True" extra-ref="EnvironmentFiles"/> @@ -8406,6 +8454,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly as Environment = ['...', ...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -8932,6 +8984,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--property EnvironmentFiles is not documented!--> <!--property PassEnvironment is not documented!--> @@ -9426,6 +9482,10 @@ node /org/freedesktop/systemd1/unit/dev_2dsda3_2eswap { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <variablelist class="dbus-property" generated="True" extra-ref="Environment"/> <variablelist class="dbus-property" generated="True" extra-ref="EnvironmentFiles"/> @@ -10053,6 +10113,10 @@ node /org/freedesktop/systemd1/unit/system_2eslice { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; }; interface org.freedesktop.DBus.Peer { ... }; interface org.freedesktop.DBus.Introspectable { ... }; @@ -10219,6 +10283,10 @@ node /org/freedesktop/systemd1/unit/system_2eslice { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--Autogenerated cross-references for systemd.directives, do not edit--> <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.systemd1.Unit"/> @@ -10391,6 +10459,10 @@ node /org/freedesktop/systemd1/unit/system_2eslice { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <!--End of Autogenerated section--> <refsect2> @@ -10586,6 +10658,10 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope { readonly a(iiqq) SocketBindDeny = [...]; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") readonly (bas) RestrictNetworkInterfaces = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly s MemoryPressureWatch = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t MemoryPressureThresholdUSec = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly s KillMode = '...'; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") @@ -10772,6 +10848,10 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope { <!--property RestrictNetworkInterfaces is not documented!--> + <!--property MemoryPressureWatch is not documented!--> + + <!--property MemoryPressureThresholdUSec is not documented!--> + <!--property KillMode is not documented!--> <!--property KillSignal is not documented!--> @@ -10974,6 +11054,10 @@ node /org/freedesktop/systemd1/unit/session_2d1_2escope { <variablelist class="dbus-property" generated="True" extra-ref="RestrictNetworkInterfaces"/> + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureWatch"/> + + <variablelist class="dbus-property" generated="True" extra-ref="MemoryPressureThresholdUSec"/> + <variablelist class="dbus-property" generated="True" extra-ref="KillMode"/> <variablelist class="dbus-property" generated="True" extra-ref="KillSignal"/> diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index 82a52e2150..71d403db8d 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -556,6 +556,18 @@ to configure the rate limit window, and <varname>ReloadLimitBurst=</varname> takes a positive integer to configure the maximum allowed number of reloads within the configured time window.</para></listitem> </varlistentry> + + <varlistentry> + <term><varname>DefaultMemoryPressureWatch=</varname></term> + <term><varname>DefaultMemoryPressureThresholdSec=</varname></term> + + <listitem><para>Configures the default settings for the per-unit + <varname>MemoryPressureWatch=</varname> and <varname>MemoryPressureThresholdSec=</varname> + settings. See + <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry> + for details. Defaults to <literal>auto</literal> and <literal>100ms</literal>, respectively. This + also sets the memory pressure monitoring threshold for the service manager itself.</para></listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index e696941682..795e2f0671 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -3779,6 +3779,16 @@ StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZX </para></listitem> </varlistentry> + <varlistentry> + <term><varname>$MEMORY_PRESSURE_WATCH</varname></term> + <term><varname>$MEMORY_PRESSURE_WRITE</varname></term> + + <listitem><para>If memory pressure monitoring is enabled for this service unit, the path to watch + and the data to write into it. See <ulink url="https://systemd.io/MEMORY_PRESSURE">Memory Pressure + Handling</ulink> for details about these variables and the service protocol data they + convey.</para></listitem> + </varlistentry> + </variablelist> <para>For system services, when <varname>PAMName=</varname> is enabled and <command>pam_systemd</command> is part diff --git a/man/systemd.resource-control.xml b/man/systemd.resource-control.xml index 27e29e853a..f057433973 100644 --- a/man/systemd.resource-control.xml +++ b/man/systemd.resource-control.xml @@ -1169,6 +1169,53 @@ DeviceAllow=/dev/loop-control </para> </listitem> </varlistentry> + + <varlistentry> + <term><varname>MemoryPressureWatch=</varname></term> + + <listitem><para>Controls memory pressure monitoring for invoked processes. Takes one of + <literal>off</literal>, <literal>on</literal>, <literal>auto</literal> or <literal>skip</literal>. If + <literal>off</literal> tells the service not to watch for memory pressure events, by setting the + <varname>$MEMORY_PRESSURE_WATCH</varname> environment variable to the literal string + <filename>/dev/null</filename>. If <literal>on</literal> tells the service to watch for memory + pressure events. This enables memory accounting for the service, and ensures the + <filename>memory.pressure</filename> cgroup attribute files is accessible for read and write to the + service's user. It then sets the <varname>$MEMORY_PRESSURE_WATCH</varname> environment variable for + processes invoked by the unit to the file system path to this file. The threshold information + configured with <varname>MemoryPressureThresholdSec=</varname> is encoded in the + <varname>$MEMORY_PRESSURE_WRITE</varname> environment variable. If the <literal>auto</literal> value + is set the protocol is enabled if memory accounting is anyway enabled for the unit, and disabled + otherwise. If set to <literal>skip</literal> the logic is neither enabled, nor disabled and the two + environment variables are not set.</para> + + <para>Note that services are free to use the two environment variables, but it's unproblematic if + they ignore them. Memory pressure handling must be implemented individually in each service, and + usually means different things for different software. For further details on memory pressure + handling see <ulink url="https://systemd.io/MEMORY_PRESSURE">Memory Pressure Handling in + systemd</ulink>.</para> + + <para>Services implemented using + <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry> may use + <citerefentry><refentrytitle>sd_event_add_memory_pressure</refentrytitle><manvolnum>3</manvolnum></citerefentry> + to watch for and handle memory pressure events.</para> + + <para>If not explicit set, defaults to the <varname>DefaultMemoryPressureWatch=</varname> setting in + <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem> + </varlistentry> + + <varlistentry> + <term><varname>MemoryPressureThresholdSec=</varname></term> + + <listitem><para>Sets the memory pressure threshold time for memory pressure monitor as configured via + <varname>MemoryPressureWatch=</varname>. Specifies the maximum allocation latency before a memory + pressure event is signalled to the service, per 1s window. If not specified defaults to the + <varname>DefaultMemoryPressureThresholdSec=</varname> setting in + <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> + (which in turn defaults to 100ms). The specified value expects 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.</para></listitem> + </varlistentry> </variablelist> </refsect1> |