提交 411cea63 编写于 作者: Z Zhou yimin 提交者: Martin Kletzander

qemu: move setting emulatorpin ahead of monitor showing up

If VM is configured with many devices(including passthrough devices)
and large memory, libvirtd will take seconds(in the worst case) to
wait for monitor. In this period the qemu process may run on any
PCPU though I intend to pin emulator to the specified PCPU in xml
configuration.

Actually qemu process takes high cpu usage during vm startup.
So this is not the strict CPU isolation in this case.
Signed-off-by: NZhou yimin <zhouyimin@huawei.com>
上级 8b9ec18d
...@@ -4553,6 +4553,14 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4553,6 +4553,14 @@ int qemuProcessStart(virConnectPtr conn,
if (ret == -1) /* The VM failed to start */ if (ret == -1) /* The VM failed to start */
goto cleanup; goto cleanup;
VIR_DEBUG("Setting cgroup for emulator (if required)");
if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0)
goto cleanup;
VIR_DEBUG("Setting affinity of emulator threads");
if (qemuProcessSetEmulatorAffinity(vm) < 0)
goto cleanup;
VIR_DEBUG("Waiting for monitor to show up"); VIR_DEBUG("Waiting for monitor to show up");
if (qemuProcessWaitForMonitor(driver, vm, asyncJob, priv->qemuCaps, pos) < 0) if (qemuProcessWaitForMonitor(driver, vm, asyncJob, priv->qemuCaps, pos) < 0)
goto cleanup; goto cleanup;
...@@ -4588,10 +4596,6 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4588,10 +4596,6 @@ int qemuProcessStart(virConnectPtr conn,
if (qemuSetupCgroupForVcpu(vm) < 0) if (qemuSetupCgroupForVcpu(vm) < 0)
goto cleanup; goto cleanup;
VIR_DEBUG("Setting cgroup for emulator (if required)");
if (qemuSetupCgroupForEmulator(driver, vm, nodemask) < 0)
goto cleanup;
VIR_DEBUG("Setting cgroup for each IOThread (if required)"); VIR_DEBUG("Setting cgroup for each IOThread (if required)");
if (qemuSetupCgroupForIOThreads(vm) < 0) if (qemuSetupCgroupForIOThreads(vm) < 0)
goto cleanup; goto cleanup;
...@@ -4600,10 +4604,6 @@ int qemuProcessStart(virConnectPtr conn, ...@@ -4600,10 +4604,6 @@ int qemuProcessStart(virConnectPtr conn,
if (qemuProcessSetVcpuAffinities(vm) < 0) if (qemuProcessSetVcpuAffinities(vm) < 0)
goto cleanup; goto cleanup;
VIR_DEBUG("Setting affinity of emulator threads");
if (qemuProcessSetEmulatorAffinity(vm) < 0)
goto cleanup;
VIR_DEBUG("Setting affinity of IOThread threads"); VIR_DEBUG("Setting affinity of IOThread threads");
if (qemuProcessSetIOThreadsAffinity(vm) < 0) if (qemuProcessSetIOThreadsAffinity(vm) < 0)
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册