summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorAnita Zhang <the.anitazha@gmail.com>2020-03-09 15:09:17 -0700
committerAnita Zhang <the.anitazha@gmail.com>2020-10-07 16:17:23 -0700
commit4d824a4e0b008a359adda0e960706316f207047e (patch)
tree04c5b68e821899102206ae1be6746632aa96d9cd /src/basic/cgroup-util.c
parent5177cb0a9add4ae568cff6e6f7c2b3c77760c343 (diff)
downloadsystemd-4d824a4e0b008a359adda0e960706316f207047e.tar.gz
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.
Diffstat (limited to 'src/basic/cgroup-util.c')
-rw-r--r--src/basic/cgroup-util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 6210347553..8f32296333 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -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);