]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
oomd: it's safe to assume cgv2 now 37101/head
authorMike Yuan <me@yhndnzj.com>
Fri, 11 Apr 2025 23:13:45 +0000 (01:13 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 13 Apr 2025 16:09:40 +0000 (18:09 +0200)
src/oom/oomd.c
src/oom/test-oomd-util.c
units/systemd-oomd.service.in
units/systemd-oomd.socket

index 53c4948a73283eea6037d048a20a04c77a8808c1..a75528f7e013e0c23c74cbb126839b30e5213f9b 100644 (file)
@@ -134,12 +134,6 @@ static int run(int argc, char *argv[]) {
         if (!is_pressure_supported())
                 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Pressure Stall Information (PSI) is not supported");
 
-        r = cg_all_unified();
-        if (r < 0)
-                return log_error_errno(r, "Failed to determine whether the unified cgroups hierarchy is used: %m");
-        if (r == 0)
-                return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Requires the unified cgroups hierarchy");
-
         r = cg_mask_supported(&mask);
         if (r < 0)
                 return log_error_errno(r, "Failed to get supported cgroup controllers: %m");
index 2ad20b2d15faf0bd9722b01e63e5fc7c0ccf89eb..5f007ee35ec5e9cc241589b31fdb73eed7213390 100644 (file)
@@ -46,9 +46,6 @@ static void test_oomd_cgroup_kill(void) {
         if (geteuid() != 0)
                 return (void) log_tests_skipped("not root");
 
-        if (cg_all_unified() <= 0)
-                return (void) log_tests_skipped("cgroups are not running in unified mode");
-
         assert_se(cg_pid_get_path(NULL, 0, &cgroup_root) >= 0);
 
         /* Create another cgroup below this one for the pids we forked off. We need this to be managed
@@ -103,9 +100,6 @@ static void test_oomd_cgroup_context_acquire_and_insert(void) {
         if (!is_pressure_supported())
                 return (void) log_tests_skipped("system does not support pressure");
 
-        if (cg_all_unified() <= 0)
-                return (void) log_tests_skipped("cgroups are not running in unified mode");
-
         assert_se(cg_mask_supported(&mask) >= 0);
 
         if (!FLAGS_SET(mask, CGROUP_MASK_MEMORY))
@@ -429,9 +423,6 @@ static void test_oomd_fetch_cgroup_oom_preference(void) {
         if (!is_pressure_supported())
                 return (void) log_tests_skipped("system does not support pressure");
 
-        if (cg_all_unified() <= 0)
-                return (void) log_tests_skipped("cgroups are not running in unified mode");
-
         assert_se(cg_mask_supported(&mask) >= 0);
 
         if (!FLAGS_SET(mask, CGROUP_MASK_MEMORY))
index ed120cb569a732f53a498c6b49df0ed8aa975d39..2486afe4053888f71fdd4ddd0dc3ac36c108aaa1 100644 (file)
@@ -15,7 +15,6 @@ DefaultDependencies=no
 After=swap.target
 Before=multi-user.target shutdown.target
 Conflicts=shutdown.target
-ConditionControlGroupController=v2
 ConditionControlGroupController=memory
 ConditionPathExists=/proc/pressure/cpu
 ConditionPathExists=/proc/pressure/io
index 6953f7e2b96d74a76c7e5e177e0bd4ff81986fc1..0002a95bab05c957d0a69cd54138083941a1103e 100644 (file)
@@ -13,7 +13,6 @@ Documentation=man:systemd-oomd.service(8)
 DefaultDependencies=no
 Before=sockets.target shutdown.target
 Conflicts=shutdown.target
-ConditionControlGroupController=v2
 ConditionControlGroupController=memory
 ConditionPathExists=/proc/pressure/cpu
 ConditionPathExists=/proc/pressure/io