Skip to main content

uses_reply_cgroup_fallback

Function uses_reply_cgroup_fallback 

Source
pub fn uses_reply_cgroup_fallback(
    output: &ListOutput,
    cgroup: &CgroupStats,
) -> bool
Expand description

Whether map_service_stats would take any cgroup counter from the reply because cgroupfs had no value for it.

Those reply counters are a snapshot of the moment PID 1 answered, so a reply that needs them must not be reused on a later cycle: it would report the same memory and CPU forever while the unit holds its state.

The common case is a unit with no cgroup (e.g. an exited oneshot with RemainAfterExit=yes): PID 1 still answers MemoryAvailable, recomputed live from its ancestors and the host, so such units are asked every cycle.