
On 09/03/2014 10:15 AM, John Ferlan wrote:
The following patches will add more support for IOThreads not completed from the initial patches. These changes support the remaining elements of bz https://bugzilla.redhat.com/show_bug.cgi?id=1101574 (working through unsetting the private bits - as there's nothing in there that should necessarily be private).
Changes:
1. Add "--iothread" option to virsh attach-disk to allow using a specific iothread when attaching a disk
2. Add the ability to set CPU affinity for an IOThread. This involves multiple steps (patches 2-6) of adding the infrastructure to support setting scheduler affinity for the IOThread including cgroup setup. For the most part it's a "copy" of the vCPU pinning code, but without the external interfaces - those will come at a later time after RHEL7.1.
3. Add to <cpuset/> a new element <iothreadpin iothread='#" cpuset="string"/>
NOTE: I can combine any/all of patches 2-6 - I just kept them separate so it wasn't a larger single patch.
Although future changes will support API's and virsh commands to modify the iothreadpin, this set of changes at least is backportable to RHEL7.1 since there are no external API changes.
John Ferlan (7): virsh: Add iothread to 'attach-disk' qemu: Issue query-iothreads and to get list of active IOThreads vircgroup: Introduce virCgroupNewIOThread qemu_domain: Add niothreadpids and iothreadpids
Up to this patch, things worked for me,
qemu_cgroup: Introduce cgroup functions for IOThreads qemu: Allow pinning specific IOThreads to a CPU
but with these two patches, I get a compilation failure: qemu/qemu_cgroup.c: In function 'qemuSetupCgroupForIOThreads': qemu/qemu_cgroup.c:1160:41: error: 'struct <anonymous>' has no member named 'niothreadspin' for (j = 0; j < def->cputune.niothreadspin; j++) { ^
domain_conf: Add iothreadpin to cputune
and with this patch, I'm now unable to start a transient domain, with a less-than-stellar message: $ qemu-img create -f qcow2 -o compat=0.10 base.img 10M $ virsh create /dev/stdin <<EOF <domain type='kvm'> <name>testvm1</name> <memory unit='MiB'>256</memory> <vcpu>1</vcpu> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='$PWD/base.img'/> <target dev='vda' bus='virtio'/> </disk> <graphics type='vnc'/> </devices> </domain> EOF error: Failed to create domain from /dev/stdin error: An error occurred, but the cause is unknown Normally, that command starts up a guest (yeah, the guest is doing nothing but wasting CPU cycles, because it has a blank disk, but it's a great little smoke test for my recent work in block jobs) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org