mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
use cpuset to manage numa
This patch also sets cgroup cpuset parameters for numatune.
This commit is contained in:
parent
059425ae45
commit
9d3a721ad5
@ -389,6 +389,25 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
||||
}
|
||||
}
|
||||
|
||||
if (vm->def->numatune.memory.nodemask &&
|
||||
vm->def->numatune.memory.mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
|
||||
qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
|
||||
char *mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask, VIR_DOMAIN_CPUMASK_LEN);
|
||||
if (!mask) {
|
||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to convert memory nodemask"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = virCgroupSetCpusetMems(cgroup, mask);
|
||||
VIR_FREE(mask);
|
||||
if (rc != 0) {
|
||||
virReportSystemError(-rc,
|
||||
_("Unable to set cpuset.mems for domain %s"),
|
||||
vm->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
done:
|
||||
virCgroupFree(&cgroup);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user