Compare commits

..

No commits in common. "df957acc6603a04e62dee7e911c65dc7dbcb6208" and "b9dc511954b080d8b05a44f1758be6dbb4078852" have entirely different histories.

2 changed files with 13 additions and 13 deletions

View File

@ -360,7 +360,9 @@ static char *format_cgroup_memory_limit_comparison(char *buf, size_t l, Unit *u,
}
void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) {
_cleanup_free_ char *disable_controllers_str = NULL, *cpuset_cpus = NULL, *cpuset_mems = NULL;
_cleanup_free_ char *disable_controllers_str = NULL;
_cleanup_free_ char *cpuset_cpus = NULL;
_cleanup_free_ char *cpuset_mems = NULL;
CGroupIODeviceLimit *il;
CGroupIODeviceWeight *iw;
CGroupIODeviceLatency *l;
@ -435,8 +437,8 @@ void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) {
prefix, c->startup_cpu_shares,
prefix, format_timespan(q, sizeof(q), c->cpu_quota_per_sec_usec, 1),
prefix, format_timespan(v, sizeof(v), c->cpu_quota_period_usec, 1),
prefix, strempty(cpuset_cpus),
prefix, strempty(cpuset_mems),
prefix, cpuset_cpus,
prefix, cpuset_mems,
prefix, c->io_weight,
prefix, c->startup_io_weight,
prefix, c->blockio_weight,
@ -972,10 +974,8 @@ static void cgroup_apply_unified_cpuset(Unit *u, const CPUSet *cpus, const char
_cleanup_free_ char *buf = NULL;
buf = cpu_set_to_range_string(cpus);
if (!buf) {
log_oom();
return;
}
if (!buf)
return;
(void) set_attribute_and_warn(u, "cpuset", name, buf);
}

View File

@ -926,23 +926,23 @@ int bus_cgroup_set_property(
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
_cleanup_free_ char *setstr = NULL;
_cleanup_free_ char *data = NULL;
CPUSet *set;
setstr = cpu_set_to_range_string(&new_set);
if (!setstr)
return -ENOMEM;
if (streq(name, "AllowedCPUs"))
set = &c->cpuset_cpus;
else
set = &c->cpuset_mems;
cpu_set_reset(set);
*set = new_set;
new_set = (CPUSet) {};
if (asprintf(&data, "%s=%s", name, setstr) < 0)
return -ENOMEM;
cpu_set_reset(set);
cpu_set_add_all(set, &new_set);
unit_invalidate_cgroup(u, CGROUP_MASK_CPUSET);
unit_write_settingf(u, flags, name, "%s=%s", name, setstr);
unit_write_setting(u, flags, name, data);
}
return 1;