$1.IPEgressFilterPath, config_parse_ip_filter_bpf_progs, 0, offsetof($1, cgroup_context.ip_filters_egress)
$1.ManagedOOMSwap, config_parse_managed_oom_mode, 0, offsetof($1, cgroup_context.moom_swap)
$1.ManagedOOMMemoryPressure, config_parse_managed_oom_mode, 0, offsetof($1, cgroup_context.moom_mem_pressure)
-$1.ManagedOOMMemoryPressureLimitPercent, config_parse_managed_oom_mem_pressure_limit, 0, offsetof($1, cgroup_context)
+$1.ManagedOOMMemoryPressureLimitPercent, config_parse_managed_oom_mem_pressure_limit, 0, offsetof($1, cgroup_context.moom_mem_pressure_limit)
$1.NetClass, config_parse_warn_compat, DISABLED_LEGACY, 0'
)m4_dnl
Unit.Description, config_parse_unit_string_printf, 0, offsetof(Unit, description)
const char *rvalue,
void *data,
void *userdata) {
- Unit *u = userdata;
ManagedOOMMode *mode = data, m;
UnitType t;
if (isempty(rvalue)) {
*mode = MANAGED_OOM_AUTO;
- goto finish;
+ return 0;
}
m = managed_oom_mode_from_string(rvalue);
return 0;
}
*mode = m;
-
-finish:
- (void) manager_varlink_send_managed_oom_update(u);
return 0;
}
const char *rvalue,
void *data,
void *userdata) {
- Unit *u = userdata;
- CGroupContext *c = data;
+ int *limit = data;
UnitType t;
int r;
return log_syntax(unit, LOG_WARNING, filename, line, 0, "%s= is not supported for this unit type, ignoring.", lvalue);
if (isempty(rvalue)) {
- c->moom_mem_pressure_limit = 0;
- goto finish;
+ *limit = 0;
+ return 0;
}
r = parse_percent(rvalue);
return 0;
}
- c->moom_mem_pressure_limit = r;
-
-finish:
- /* Only update the limit if memory pressure detection is enabled because the information is irrelevant otherwise */
- if (c->moom_mem_pressure == MANAGED_OOM_KILL)
- (void) manager_varlink_send_managed_oom_update(u);
+ *limit = r;
return 0;
}
unit_add_to_dbus_queue(unit_follow_merge(u));
unit_add_to_gc_queue(u);
+ (void) manager_varlink_send_managed_oom_update(u);
return 0;
* sets one of the ManagedOOM*= properties to "kill", then later removes it. systemd-oomd needs to
* know to stop monitoring when the unit changes from "kill" -> "auto" on daemon-reload, but we don't
* have the information on the property. Thus, indiscriminately send an update. */
- if (UNIT_IS_INACTIVE_OR_FAILED(ns) || ns == UNIT_ACTIVE)
+ if (UNIT_IS_INACTIVE_OR_FAILED(ns) || UNIT_IS_ACTIVE_OR_RELOADING(ns))
(void) manager_varlink_send_managed_oom_update(u);
}