Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-27 Thread Paolo Bonzini
Il 27/06/2013 04:08, liu ping fan ha scritto: >> > qdev_free is triggered by the guest, but free is a misnomer. It is >> > really "make it inaccessible from the guest and management" (the kernel >> > equivalent would be removal of /dev and /sys entries, for example). The >> > actual "free" will h

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-26 Thread liu ping fan
On Wed, Jun 26, 2013 at 5:55 PM, Paolo Bonzini wrote: > Il 26/06/2013 11:44, liu ping fan ha scritto: >> On Wed, Jun 26, 2013 at 4:38 PM, Paolo Bonzini wrote: >>> Il 26/06/2013 10:20, liu ping fan ha scritto: >> On the other hand, pushing _delete() out of finalization path is not >> easy

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-26 Thread Paolo Bonzini
Il 26/06/2013 11:44, liu ping fan ha scritto: > On Wed, Jun 26, 2013 at 4:38 PM, Paolo Bonzini wrote: >> Il 26/06/2013 10:20, liu ping fan ha scritto: > On the other hand, pushing _delete() out of finalization path is not > easy, since we do not what time the DeviceState has done with its

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-26 Thread liu ping fan
On Wed, Jun 26, 2013 at 4:38 PM, Paolo Bonzini wrote: > Il 26/06/2013 10:20, liu ping fan ha scritto: On the other hand, pushing _delete() out of finalization path is not easy, since we do not what time the DeviceState has done with its bh. >>> >>> See above: >>> >>> - if the BH will ru

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-26 Thread Paolo Bonzini
Il 26/06/2013 10:20, liu ping fan ha scritto: >>> On the other hand, pushing _delete() out of finalization path is not >>> easy, since we do not what time the DeviceState has done with its bh. >> >> See above: >> >> - if the BH will run in the iothread, the BH is definitely not running >> (because

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-26 Thread liu ping fan
On Wed, Jun 26, 2013 at 2:34 PM, Paolo Bonzini wrote: > Il 26/06/2013 04:59, liu ping fan ha scritto: >>> The latter part could be the hard one in a multi-threaded context, but I >>> think it's up to the device to ensure it. It doesn't _have_ to be hard. >>> For example, joining the data-plane t

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-25 Thread Paolo Bonzini
Il 26/06/2013 04:59, liu ping fan ha scritto: >> The latter part could be the hard one in a multi-threaded context, but I >> think it's up to the device to ensure it. It doesn't _have_ to be hard. >> For example, joining the data-plane thread would do that as well. >> > It seems not easy, take co

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-25 Thread liu ping fan
On Tue, Jun 25, 2013 at 3:53 PM, Paolo Bonzini wrote: > Il 25/06/2013 08:32, liu ping fan ha scritto: >> On Tue, Jun 25, 2013 at 2:24 PM, Paolo Bonzini wrote: >>> Il 25/06/2013 19:38, Liu Ping Fan ha scritto: This series relies on refcnt of object used by bh callback to run against unp

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-25 Thread Paolo Bonzini
Il 25/06/2013 08:32, liu ping fan ha scritto: > On Tue, Jun 25, 2013 at 2:24 PM, Paolo Bonzini wrote: >> Il 25/06/2013 19:38, Liu Ping Fan ha scritto: >>> This series relies on refcnt of object used by bh callback to run against >>> unplug. >>> >>> Open issue: >>> Another choice may be rcu, but I

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-24 Thread Paolo Bonzini
Il 25/06/2013 19:38, Liu Ping Fan ha scritto: > This series relies on refcnt of object used by bh callback to run against > unplug. > > Open issue: > Another choice may be rcu, but I think some issues are hard to resolve. > Using rcu, we have two choice: > when holding object refcnt, call qemu_

Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-24 Thread liu ping fan
On Tue, Jun 25, 2013 at 2:24 PM, Paolo Bonzini wrote: > Il 25/06/2013 19:38, Liu Ping Fan ha scritto: >> This series relies on refcnt of object used by bh callback to run against >> unplug. >> >> Open issue: >> Another choice may be rcu, but I think some issues are hard to resolve. >> Using rcu,

[Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug

2013-06-24 Thread Liu Ping Fan
This series relies on refcnt of object used by bh callback to run against unplug. Open issue: Another choice may be rcu, but I think some issues are hard to resolve. Using rcu, we have two choice: when holding object refcnt, call qemu_bh_delete(); then after grace period, we can release. Or