From: Mike Yuan Date: Fri, 11 Apr 2025 23:13:45 +0000 (+0200) Subject: oomd: it's safe to assume cgv2 now X-Git-Tag: v258-rc1~826^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a04da2db6b6fcce94fc7d87388f199fff48ae5d8;p=thirdparty%2Fsystemd.git oomd: it's safe to assume cgv2 now --- diff --git a/src/oom/oomd.c b/src/oom/oomd.c index 53c4948a732..a75528f7e01 100644 --- a/src/oom/oomd.c +++ b/src/oom/oomd.c @@ -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"); diff --git a/src/oom/test-oomd-util.c b/src/oom/test-oomd-util.c index 2ad20b2d15f..5f007ee35ec 100644 --- a/src/oom/test-oomd-util.c +++ b/src/oom/test-oomd-util.c @@ -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)) diff --git a/units/systemd-oomd.service.in b/units/systemd-oomd.service.in index ed120cb569a..2486afe4053 100644 --- a/units/systemd-oomd.service.in +++ b/units/systemd-oomd.service.in @@ -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 diff --git a/units/systemd-oomd.socket b/units/systemd-oomd.socket index 6953f7e2b96..0002a95bab0 100644 --- a/units/systemd-oomd.socket +++ b/units/systemd-oomd.socket @@ -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