diff options
author | David Tardon <dtardon@redhat.com> | 2020-06-23 13:58:21 +0200 |
---|---|---|
committer | The Plumber <50238977+systemd-rhel-bot@users.noreply.github.com> | 2020-06-26 12:25:18 +0200 |
commit | 8e1cc941607263a4f8454d0d6d5939aec3be1fcb (patch) | |
tree | d130789545e4a39ff04e6bd8929368d0e25602ec | |
parent | 762959047c1e1a5d4b6a6fe85cfa8a14c622e4da (diff) | |
download | systemd-8e1cc941607263a4f8454d0d6d5939aec3be1fcb.tar.gz |
fix mis-merge
Resolves: #1848421
-rw-r--r-- | src/core/cgroup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 2d819b8ebb..e0eb184fd2 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) { |