Compare commits
4 Commits
b9dc511954
...
df957acc66
Author | SHA1 | Date |
---|---|---|
Lennart Poettering | df957acc66 | |
Lennart Poettering | a897a7b837 | |
Lennart Poettering | c259ac9aa2 | |
Lennart Poettering | 85c3b27891 |
|
@ -360,9 +360,7 @@ 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;
|
||||
_cleanup_free_ char *cpuset_cpus = NULL;
|
||||
_cleanup_free_ char *cpuset_mems = NULL;
|
||||
_cleanup_free_ char *disable_controllers_str = NULL, *cpuset_cpus = NULL, *cpuset_mems = NULL;
|
||||
CGroupIODeviceLimit *il;
|
||||
CGroupIODeviceWeight *iw;
|
||||
CGroupIODeviceLatency *l;
|
||||
|
@ -437,8 +435,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, cpuset_cpus,
|
||||
prefix, cpuset_mems,
|
||||
prefix, strempty(cpuset_cpus),
|
||||
prefix, strempty(cpuset_mems),
|
||||
prefix, c->io_weight,
|
||||
prefix, c->startup_io_weight,
|
||||
prefix, c->blockio_weight,
|
||||
|
@ -974,8 +972,10 @@ 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)
|
||||
return;
|
||||
if (!buf) {
|
||||
log_oom();
|
||||
return;
|
||||
}
|
||||
|
||||
(void) set_attribute_and_warn(u, "cpuset", name, buf);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
if (asprintf(&data, "%s=%s", name, setstr) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
cpu_set_reset(set);
|
||||
cpu_set_add_all(set, &new_set);
|
||||
*set = new_set;
|
||||
new_set = (CPUSet) {};
|
||||
|
||||
unit_invalidate_cgroup(u, CGROUP_MASK_CPUSET);
|
||||
unit_write_setting(u, flags, name, data);
|
||||
unit_write_settingf(u, flags, name, "%s=%s", name, setstr);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue