diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 4667d41ae3..f823de50e4 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -3950,7 +3950,11 @@ bool unit_invalidate_cgroup(Unit *u, CGroupMask m) { if (!crt) return false; - if (FLAGS_SET(crt->cgroup_invalidated_mask, m)) /* NOP? */ + /* If all controllers shall be invalidated, let's unconditionally submit the unit to realize queue. + * We initialize the field to _CGROUP_MASK_ALL after all, and semantically it makes sense to use + * it as a special signal to forcibly re-realize cgroup. */ + if (m != _CGROUP_MASK_ALL && + FLAGS_SET(crt->cgroup_invalidated_mask, m)) /* NOP? */ return false; crt->cgroup_invalidated_mask |= m; @@ -4380,8 +4384,7 @@ int cgroup_runtime_deserialize_one(Unit *u, const char *key, const char *value, if (!UNIT_HAS_CGROUP_CONTEXT(u)) return 0; - if (MATCH_DESERIALIZE_IMMEDIATE(u, "cpu-usage-base", key, value, safe_atou64, cpu_usage_base) || - MATCH_DESERIALIZE_IMMEDIATE(u, "cpuacct-usage-base", key, value, safe_atou64, cpu_usage_base)) + if (MATCH_DESERIALIZE_IMMEDIATE(u, "cpu-usage-base", key, value, safe_atou64, cpu_usage_base)) return 1; if (MATCH_DESERIALIZE_IMMEDIATE(u, "cpu-usage-last", key, value, safe_atou64, cpu_usage_last)) diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index 771308848a..6058553aac 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -5552,7 +5552,7 @@ int exec_invoke( * memory_pressure_path != NULL in the conditional below. */ if (memory_pressure_path && needs_sandboxing && exec_needs_cgroup_namespace(context)) { memory_pressure_path = mfree(memory_pressure_path); - r = cg_get_path("memory", "", "memory.pressure", &memory_pressure_path); + r = cg_get_path("memory", "/", "memory.pressure", &memory_pressure_path); if (r < 0) { *exit_status = EXIT_MEMORY; return log_oom();