[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-lo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-loop |
Date: |
Wed, 25 Jul 2012 10:22:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
Il 25/07/2012 10:16, liu ping fan ha scritto:
> > It's not clear how to me. The only reference to devices from an
> > iohandler/bh/timer can be in the opaque. Now, if you have a
> > iohandler/bh/timer whose opaque is a DeviceState, you should bump the
> > refcount before setting it up, and unref after tearing it down.
>
> Yes, I admit refcnt is a good solution, but I think it means that we
> will fix it with each device's bh. And this way seems lazy.
Most of the time the bh/timer/iohandler is created in the init function,
and deleted in the exit function, so in this case the lifecycle is even
easier to manage.
Looking at your patch again, it seems like you're implementing a
poor-man RCU. So that's fine for a proof-of-concept, but let's replace
it with real RCU sooner or later.
Paolo
- [Qemu-devel] [PATCH 0/5] prepare unplug out of protection of global lock, Liu Ping Fan, 2012/07/24
- [Qemu-devel] [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it, Liu Ping Fan, 2012/07/24
- [Qemu-devel] [PATCH 2/5] exec.c: use refcnt to protect device during dispatching, Liu Ping Fan, 2012/07/24
- [Qemu-devel] [PATCH 3/5] hotplug: introduce qdev_unplug_ack() to remove device from views, Liu Ping Fan, 2012/07/24
- [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-loop, Liu Ping Fan, 2012/07/24
- Re: [Qemu-devel] [PATCH 4/5] qom: delay DeviceState's reclaim to main-loop, liu ping fan, 2012/07/25
[Qemu-devel] [PATCH 5/5] e1000: using new interface--unmap to unplug, Liu Ping Fan, 2012/07/24