Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-23 Thread Jan Kiszka
On 2012-06-23 00:56, Anthony Liguori wrote: > On 06/22/2012 05:27 PM, Jan Kiszka wrote: >> On 2012-06-22 23:44, Anthony Liguori wrote: >>> 1) unlock iothread before entering the do {} look in kvm_cpu_exec() >>> a) reacquire the lock after the loop >>> b) reacquire the lock in kvm_handle_io(

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Anthony Liguori
On 06/22/2012 05:27 PM, Jan Kiszka wrote: On 2012-06-22 23:44, Anthony Liguori wrote: 1) unlock iothread before entering the do {} look in kvm_cpu_exec() a) reacquire the lock after the loop b) reacquire the lock in kvm_handle_io() c) introduce an unlocked memory accessor that for no

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Jan Kiszka
On 2012-06-22 23:44, Anthony Liguori wrote: > On 06/22/2012 04:14 PM, Jan Kiszka wrote: >> On 2012-06-22 22:11, Anthony Liguori wrote: >>> On 06/22/2012 05:37 AM, Jan Kiszka wrote: On 2012-06-22 12:24, liu ping fan wrote: > On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka > wrote: >> O

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Anthony Liguori
On 06/22/2012 04:14 PM, Jan Kiszka wrote: On 2012-06-22 22:11, Anthony Liguori wrote: On 06/22/2012 05:37 AM, Jan Kiszka wrote: On 2012-06-22 12:24, liu ping fan wrote: On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka wrote: On 2012-06-21 16:49, Liu Ping Fan wrote: Nowadays, we use qemu_mutex_lo

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Jan Kiszka
On 2012-06-22 22:11, Anthony Liguori wrote: > On 06/22/2012 05:37 AM, Jan Kiszka wrote: >> On 2012-06-22 12:24, liu ping fan wrote: >>> On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka >>> wrote: On 2012-06-21 16:49, Liu Ping Fan wrote: > Nowadays, we use > qemu_mutex_lock_iothread()/qemu

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Anthony Liguori
On 06/22/2012 05:37 AM, Jan Kiszka wrote: On 2012-06-22 12:24, liu ping fan wrote: On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka wrote: On 2012-06-21 16:49, Liu Ping Fan wrote: Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to protect the race to access the emulated d

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread Jan Kiszka
On 2012-06-22 12:24, liu ping fan wrote: > On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka wrote: >> On 2012-06-21 16:49, Liu Ping Fan wrote: >>> Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to >>> protect the race to access the emulated dev launched by vcpu threads & >>>

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-22 Thread liu ping fan
On Thu, Jun 21, 2012 at 11:23 PM, Jan Kiszka wrote: > On 2012-06-21 16:49, Liu Ping Fan wrote: >> Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to >> protect the race to access the emulated dev launched by vcpu threads & >> iothread. >> >> But this lock is too big. We c

Re: [Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-21 Thread Jan Kiszka
On 2012-06-21 16:49, Liu Ping Fan wrote: > Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to > protect the race to access the emulated dev launched by vcpu threads & > iothread. > > But this lock is too big. We can break it down. > These patches separate the CPUArchState

[Qemu-devel] [RFC] use little granularity lock to substitue qemu_mutex_lock_iothread

2012-06-21 Thread Liu Ping Fan
Nowadays, we use qemu_mutex_lock_iothread()/qemu_mutex_unlock_iothread() to protect the race to access the emulated dev launched by vcpu threads & iothread. But this lock is too big. We can break it down. These patches separate the CPUArchState's protection from the other devices, so we can have