From: Mike Yuan Date: Mon, 19 Jan 2026 01:05:33 +0000 (+0100) Subject: core/cgroup: do not consider cgroup_context_has_io_config() if only IOAccounting=yes X-Git-Tag: v260-rc1~363^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d57fdbb5e29dbec320eb755e5512ba57033ddbc7;p=thirdparty%2Fsystemd.git core/cgroup: do not consider cgroup_context_has_io_config() if only IOAccounting=yes This makes things in line with unit_has_memory_config(), and suppresses pointless application of IO configs. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index c4336cd80ec..6519440e457 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1150,8 +1150,9 @@ static void cgroup_apply_cpuset(Unit *u, const CPUSet *cpus, const char *name) { } static bool cgroup_context_has_io_config(CGroupContext *c) { - return c->io_accounting || - c->io_weight != CGROUP_WEIGHT_INVALID || + assert(c); + + return c->io_weight != CGROUP_WEIGHT_INVALID || c->startup_io_weight != CGROUP_WEIGHT_INVALID || c->io_device_weights || c->io_device_latencies || @@ -1691,7 +1692,8 @@ static CGroupMask unit_get_cgroup_mask(Unit *u) { if (cgroup_context_has_allowed_cpus(c) || cgroup_context_has_allowed_mems(c)) mask |= CGROUP_MASK_CPUSET; - if (cgroup_context_has_io_config(c)) + if (c->io_accounting || + cgroup_context_has_io_config(c)) mask |= CGROUP_MASK_IO; if (c->memory_accounting ||