Red Hat Bugzilla – Bug 709397
virtio-serial unthrottling needs to use a bottomhalf to avoid recursion
Last modified: 2014-08-04 18:08:42 EDT
Description of problem: current virtio serial unthrottling callback does a straight call to the callback, which can lead to a second call to the user on the same stack, which should be avoided. qemu already has a bottomhalf mechanism for this. It is implemented to call all bh before going back to select in the mainloop, so no wait is involved (except for a few instructions).
Hi,Alon Would you please give our qe efficient way to reproduce & verify this issue? thanks
Hi Juzhang, There is none.. this is not user visible at all, it just changes the way the callback for sending queued messages to the chardev inside qemu code is called. Without this patch is was called directly, with this patch it is called from the qemu event loop (main_loop) via the bh (bottom half) mechanism. This is basically to cleanup some code that was overly complicated in spice_qemu_char.c (the spicevmc chardev). The patch for the later has not been sent yet. I'll probably open another bug just for it. Maybe there is some flag I should put on the bug to indicate "code cleanup bug"? Alon
I'd recommend QE to test guest->host file transfer with a very large file (2+GB) and ensure they receive the entire file fine on the host. That will ensure the throttling code is executed and this path hasn't regressed.
Mark this issue qa_ack+ We will verify this issue according to comment6 and check source code whether apply in fixed version
verified on qemu-kvm-0.12.1.2-2.184.el6.x86_64 steps to verify: 1./usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4 -name rhel6-32 -uuid ddcbfb49-3411-1701-3c36-6bdbc00bedb9 -rtc base=utc,clock=host,driftfix=slew -boot c -drive file=/dev/migrate/data1,if=none,id=drive-virtio-0-1,format=qcow2,cache=none,werror=ignore,rerror=ignore -device virtio-blk-pci,drive=drive-virtio-0-1,id=virt0-0-1 -netdev tap,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:19:3b:80 -spice disable-ticketing,port=5913 -monitor stdio -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x6 -chardev socket,id=channel0,path=/tmp/port0,server,nowait -device virtserialport,chardev=channel0,name=org.linux-kvm.port.0,bus=virtio-serial0.0,id=port0 2.dd if=/dev/zero of=2Gfile bs=1M count=2000 and md5sum 2Gfile in guest 3.cat 2Gfile >/dev/vport0p1 in guest 4.nc -U /tmp/port0 >2Gfile.out 5.md5sum 2Gfile 6.compare md5sum values actual result: two 2Gfile values are same. check source code: below is part changelog of build qemu-kvm-0.12.1.2-2.172.el6 Changelog - kvm-virtio-serial-bus-use-bh-for-unthrottling.patch [bz#709397] - Resolves: bz#709397 build qemu-kvm-0.12.1.2-2.172.el6 have included the patch. base on above, this bug has been fixed.
adding note that technical note is not required.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: I don't think a technical note is required. This is not user visible (not easily, not in the bug description).
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2011-1531.html