qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c


From: Kevin Wolf
Subject: Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c
Date: Wed, 28 Apr 2010 11:08:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]