]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup: Fix MemoryAvailable= by considering physical memory
authorMichal Koutný <mkoutny@suse.com>
Thu, 7 Sep 2023 16:50:08 +0000 (18:50 +0200)
committerMichal Koutný <mkoutny@suse.com>
Fri, 8 Sep 2023 17:05:52 +0000 (19:05 +0200)
commit3565c709f587a3d29d412d81355f8dd9d565a39e
tree47b10c01bcd3534c2798377fdcc3c15955646ab3
parent93f1da45566d064f4f053b37bbac2813631f58b1
cgroup: Fix MemoryAvailable= by considering physical memory

Currently, querying a unit's available memory would result in infinity
if there are no limits set on the unit or ancestors.
That undermines semantics implied by the name, so look at the physical
memory if the search propagates up to the -.slice.
This makes sense even in systemd user instances, limits of -.slice are
still looked at too.

Also change printed representation of infinite MemoryAvailable which
means we could not figure out a good estimate.
src/core/cgroup.c
src/shared/bus-print-properties.c