oomd: it's safe to assume cgv2 now

This commit is contained in:
Mike Yuan
2025-04-12 01:13:45 +02:00
parent f74ca66e68
commit a04da2db6b
4 changed files with 0 additions and 17 deletions

View 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");

View 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))

View 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

View 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