Re: Potential thread synchronization issue in qcow2.c and qcow2-cluster.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You are absolute right and this solved the puzzle. I also did
profiling to confirm your observation. Thank you for all the help!

> Hi again, I took another look at qemu-kvm 0.12.3 and here is how I read it:
>
> The mutex which is supposed to protect IO emulation is qemu-kvm.c:qemu_mutex.
>
> The cpu thread will unlock qemu_mutex in pre_kvm_run() before
> ioctl(fd, KVM_RUN, 0).  Then it will lock qemu_mutex again in
> post_kvm_run().
>
> The io thread will unlock qemu_mutex via
> qemu-kvm.c:qemu_mutex_unlock_iothread() before waiting in select().
> Then it will lock qemu_mutex again in
> qemu-kvm.c:qemu_mutex_lock_iothread().
>
> I believe this *does* protect IO emulation correctly.  The code is
> confusing because there are multiple definitions of the same functions
> and #ifdefs, maybe I made a mistake.

 Regards,
CQ Tang
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux