[libvirt] [PATCH v3 12/13] qemu: iothread: Aggregate code to set IOThread tuning
Ján Tomko
jtomko at redhat.com
Fri Feb 5 19:44:43 UTC 2016
On Fri, Feb 05, 2016 at 04:44:48PM +0100, Peter Krempa wrote:
> Rather than iterating 3 times for various settings this function
> aggregates all the code into single place. One of the other advantages
> is that it can then be reused for properly setting IOThread info on
> hotplug.
> ---
> src/qemu/qemu_cgroup.c | 93 ---------------------------
> src/qemu/qemu_cgroup.h | 1 -
> src/qemu/qemu_process.c | 165 +++++++++++++++++++++++++++++++++---------------
> src/qemu/qemu_process.h | 2 +
> 4 files changed, 116 insertions(+), 145 deletions(-)
>
> @@ -4548,6 +4507,118 @@ qemuProcessSetupVcpus(virDomainObjPtr vm)
> + if (cpumask) {
> + if (virProcessSetAffinity(iothread->thread_id, cpumask) < 0)
> + goto cleanup;
> + }
> +
This affinity setting was originally also done after moving the thread
to its cgroup...
> + if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
> + if (mem_mask &&
> + virCgroupSetCpusetMems(cgroup_iothread, mem_mask) < 0)
> + goto cleanup;
> +
> + if (cpumask &&
> + qemuSetupCgroupCpusetCpus(cgroup_iothread, cpumask) < 0)
> + goto cleanup;
> + }
> +
> + if (cgroup_iothread &&
> + virCgroupAddTask(cgroup_iothread, iothread->thread_id) < 0)
> + goto cleanup;
> +
... here.
Jan
> + if (iothread->sched.policy != VIR_PROC_POLICY_NONE &&
> + virProcessSetScheduler(iothread->thread_id, iothread->sched.policy,
> + iothread->sched.priority) < 0)
> + goto cleanup;
> +
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160205/5dbc3c99/attachment-0001.sig>
More information about the libvir-list
mailing list