mirror of
https://github.com/systemd/systemd.git
synced 2024-12-21 13:34:21 +03:00
158fe190af
Typically, in reasonably complex programs we want to realease various caches (such as glibc allocation caches) in case of memory pressure. Let's add explicit infrastructure for that to sd-event, that can hook Linux' Pressure Stall Information (PSI) logic with our event loop. This adds sd_event_add_memory_pressure() as easy, one-step API to install an even source that is called under memory pressure. The parameters which file to watch (the per-cgroup PSI file, or the system-wide file /proc/pressure/memory) can be configured via env vars. The idea is that the service manager sooner or later gains controls for setting this up correctly. Alternatively to the PSI a similar logic is supported but instead of waiting for POLLPRI on a procfs/cgroupfs fd we'll wait for POLLIN on FIFO or AF_UNIX sockets. This is useful for testing, and possibly in other environments, for example to hook up this protocol directly with GNOME's low memory monitor. By default this watches on the cgroup-local PSI so that we aren't affected by pressure on cgroups we are not related to. |
||
---|---|---|
.. | ||
meson.build | ||
systemd.be.catalog.in | ||
systemd.be@latin.catalog.in | ||
systemd.bg.catalog.in | ||
systemd.catalog.in | ||
systemd.da.catalog.in | ||
systemd.de.catalog.in | ||
systemd.fr.catalog.in | ||
systemd.hr.catalog.in | ||
systemd.hu.catalog.in | ||
systemd.it.catalog.in | ||
systemd.ko.catalog.in | ||
systemd.pl.catalog.in | ||
systemd.pt_BR.catalog.in | ||
systemd.ru.catalog.in | ||
systemd.sr.catalog.in | ||
systemd.zh_CN.catalog.in | ||
systemd.zh_TW.catalog.in |