summaryrefslogtreecommitdiff
path: root/LICENSE.GPL2
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-02-10 16:44:24 +0100
committerLennart Poettering <lennart@poettering.net>2023-02-22 13:09:42 +0100
commit158fe190afe37b222c9dc2c53bd7be426b92ef89 (patch)
treee9f2a08d7fd364ede9213da53af8a5684c7e13a8 /LICENSE.GPL2
parent81cfea95e51c72da6765b517e7038b3e7e3dec9f (diff)
downloadsystemd-158fe190afe37b222c9dc2c53bd7be426b92ef89.tar.gz
sd-event: add high-level sd_event_add_memory_pressure() event source
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.
Diffstat (limited to 'LICENSE.GPL2')
0 files changed, 0 insertions, 0 deletions