mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu: cgroup: Refactor setup for IOThread cgroups
Use the default or auto cpuset if they are provided for IOThreads.
This commit is contained in:
parent
c9f9fa25d3
commit
7095006921
@ -1255,23 +1255,28 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm)
|
|||||||
/* Set iothreadpin in cgroup if iothreadpin xml is provided */
|
/* Set iothreadpin in cgroup if iothreadpin xml is provided */
|
||||||
if (virCgroupHasController(priv->cgroup,
|
if (virCgroupHasController(priv->cgroup,
|
||||||
VIR_CGROUP_CONTROLLER_CPUSET)) {
|
VIR_CGROUP_CONTROLLER_CPUSET)) {
|
||||||
/* find the right CPU to pin, otherwise
|
virBitmapPtr cpumask = NULL;
|
||||||
* qemuSetupCgroupIOThreadsPin will fail. */
|
|
||||||
|
/* default cpu masks */
|
||||||
|
if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)
|
||||||
|
cpumask = priv->autoCpuset;
|
||||||
|
else
|
||||||
|
cpumask = def->cpumask;
|
||||||
|
|
||||||
|
/* specific cpu mask */
|
||||||
for (j = 0; j < def->cputune.niothreadspin; j++) {
|
for (j = 0; j < def->cputune.niothreadspin; j++) {
|
||||||
/* IOThreads are numbered/named 1..n */
|
/* IOThreads are numbered/named 1..n */
|
||||||
if (def->cputune.iothreadspin[j]->id != i + 1)
|
if (def->cputune.iothreadspin[j]->id == i + 1) {
|
||||||
continue;
|
cpumask = def->cputune.iothreadspin[j]->cpumask;
|
||||||
|
|
||||||
if (qemuSetupCgroupIOThreadsPin(cgroup_iothread,
|
|
||||||
def->cputune.iothreadspin,
|
|
||||||
def->cputune.niothreadspin,
|
|
||||||
i + 1) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cpumask &&
|
||||||
|
qemuSetupCgroupEmulatorPin(cgroup_iothread, cpumask) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
virCgroupFree(&cgroup_iothread);
|
virCgroupFree(&cgroup_iothread);
|
||||||
}
|
}
|
||||||
VIR_FREE(mem_mask);
|
VIR_FREE(mem_mask);
|
||||||
|
Loading…
Reference in New Issue
Block a user