Am 27.04.2010 22:39, schrieb Chunqiang (CQ) Tang: >> kvm-all.c:kvm_cpu_exec: >> qemu_mutex_unlock_iothread(); >> ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); >> qemu_mutex_lock_iothread(); > > Thank you for the information. I also suspected that > qemu_mutex_lock_iothread() does the synchronization. However, my > profiling showed that qemu-kvm.c:kvm_cpu_exec() in is actually > executed, instead of kvm-all.c:kvm_cpu_exec(). Also I previously > profiled all executions of qemu_mutex_lock_iothread(), and found that > it only protects the vl.c:main_loop_wai() thread but does NOT protect > the qemu-kvm.c:kvm_cpu_exec() thread. Did I miss something or is this > a defect? I did extensive profiling but still don't know the source > code well enough to confidently draw a conclusion.
That code path exists only in qemu-kvm, but yes, looks wrong to me. The block drivers are definitely not prepared to run in parallel in multiple threads. Avi, something missing there in qemu-kvm? Kevin