From 6eaf2a8a72269ec7bf4f548c3646f76313cc9d90 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Dec 15 2020 17:55:22 +0000 Subject: fix mis-merge Resolves: #1848421 patch_name: 0428-fix-mis-merge.patch present_in_specfile: true location_in_specfile: 428 squash_commits: true --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 2d819b8..e0eb184 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -664,11 +664,13 @@ static void cgroup_apply_legacy_cpu_config(Unit *u, uint64_t shares, uint64_t qu if (quota != USEC_INFINITY) { xsprintf(buf, USEC_FMT "\n", MAX(quota * period / USEC_PER_SEC, USEC_PER_MSEC)); + r = cg_set_attribute("cpu", u->cgroup_path, "cpu.cfs_quota_us", buf); + } + else r = cg_set_attribute("cpu", u->cgroup_path, "cpu.cfs_quota_us", "-1"); if (r < 0) log_unit_full(u, IN_SET(r, -ENOENT, -EROFS, -EACCES) ? LOG_DEBUG : LOG_WARNING, r, "Failed to set cpu.cfs_quota_us: %m"); - } } static uint64_t cgroup_cpu_shares_to_weight(uint64_t shares) {