core: add ManagedOOM*= properties to configure systemd-oomd on the unit
This adds the hook ups so it can be read with the usual systemd utilities. Used in later commits by sytemd-oomd.
This commit is contained in:
@@ -2161,3 +2161,10 @@ CGroupMask get_cpu_accounting_mask(void) {
|
||||
bool cpu_accounting_is_cheap(void) {
|
||||
return get_cpu_accounting_mask() == 0;
|
||||
}
|
||||
|
||||
static const char* const managed_oom_mode_table[_MANAGED_OOM_MODE_MAX] = {
|
||||
[MANAGED_OOM_AUTO] = "auto",
|
||||
[MANAGED_OOM_KILL] = "kill",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(managed_oom_mode, ManagedOOMMode);
|
||||
|
||||
@@ -275,3 +275,13 @@ CGroupController cgroup_controller_from_string(const char *s) _pure_;
|
||||
|
||||
bool is_cgroup_fs(const struct statfs *s);
|
||||
bool fd_is_cgroup_fs(int fd);
|
||||
|
||||
typedef enum ManagedOOMMode {
|
||||
MANAGED_OOM_AUTO,
|
||||
MANAGED_OOM_KILL,
|
||||
_MANAGED_OOM_MODE_MAX,
|
||||
_MANAGED_OOM_MODE_INVALID = -1,
|
||||
} ManagedOOMMode;
|
||||
|
||||
const char* managed_oom_mode_to_string(ManagedOOMMode m) _const_;
|
||||
ManagedOOMMode managed_oom_mode_from_string(const char *s) _pure_;
|
||||
|
||||
Reference in New Issue
Block a user