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() c)

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 jan.kis...@siemens.com 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

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 jan.kis...@siemens.com 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

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 Kiszkajan.kis...@siemens.com 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

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 Kiszkajan.kis...@siemens.com wrote: On 2012-06-21 16:49, Liu Ping Fan wrote: Nowadays, we use

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 Kiszkajan.kis...@siemens.com wrote: On 2012-06-21 16:49, Liu Ping Fan wrote:

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 Kiszkajan.kis...@siemens.com wrote: On

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

[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

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's