mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
qemu: do not put a task into machine cgroup
The machine cgroup is a superset, a parent to the emulator and vcpuX cgroups. The parent cgroup should never have any tasks directly in it. In fact the parent cpuset might contain way more cpus than the sum of emulatorpin and vcpupins. So putting tasks in the superset will allow them to run outside of <cputune>. Signed-off-by: Henning Schild <henning.schild@siemens.com>
This commit is contained in:
parent
71ce475967
commit
a41c00b472
@ -789,17 +789,6 @@ qemuInitCgroup(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virCgroupAddTask(priv->cgroup, vm->pid) < 0) {
|
|
||||||
virErrorPtr saved = virSaveLastError();
|
|
||||||
virCgroupRemove(priv->cgroup);
|
|
||||||
virCgroupFree(&priv->cgroup);
|
|
||||||
if (saved) {
|
|
||||||
virSetError(saved);
|
|
||||||
virFreeError(saved);
|
|
||||||
}
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -1170,6 +1159,10 @@ qemuSetupCgroupForEmulator(virDomainObjPtr vm)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* consider the first thread an emulator-thread */
|
||||||
|
if (virCgroupAddTask(cgroup_emulator, vm->pid) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
virCgroupFree(&cgroup_emulator);
|
virCgroupFree(&cgroup_emulator);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -4888,12 +4888,6 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
|
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* This must be done after cgroup placement to avoid resetting CPU
|
|
||||||
* affinity */
|
|
||||||
if (!vm->def->cputune.emulatorpin &&
|
|
||||||
qemuProcessInitCpuAffinity(vm) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
VIR_DEBUG("Setting domain security labels");
|
VIR_DEBUG("Setting domain security labels");
|
||||||
if (virSecurityManagerSetAllLabel(driver->securityManager,
|
if (virSecurityManagerSetAllLabel(driver->securityManager,
|
||||||
vm->def,
|
vm->def,
|
||||||
@ -4940,6 +4934,12 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
if (qemuSetupCgroupForEmulator(vm) < 0)
|
if (qemuSetupCgroupForEmulator(vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
/* This must be done after cgroup placement to avoid resetting CPU
|
||||||
|
* affinity */
|
||||||
|
if (!vm->def->cputune.emulatorpin &&
|
||||||
|
qemuProcessInitCpuAffinity(vm) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG("Setting affinity of emulator threads");
|
VIR_DEBUG("Setting affinity of emulator threads");
|
||||||
if (qemuProcessSetEmulatorAffinity(vm) < 0)
|
if (qemuProcessSetEmulatorAffinity(vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user