[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug |
Date: |
Wed, 26 Jun 2013 08:34:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
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 consideration of the sequence:
> _bh_delete(), // ensure not scheduled, ie, no further access to
> DeviceState
> wait for rcu grace period to come, // ensure not running
> free DeviceState in rcu-reclaimer
> But in current code, _delete() can be placed in DeviceState
> finalization path(in reclaimer), which means while reclaiming, there
> still exist access path to the DeviceState.
It can be placed there, but it doesn't mean it is a good idea. :)
> 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 the BH runs under the BQL, and the reclaimer owns it)
- if the BH is running in another thread, waiting for that thread to
terminate obviously makes the BH not running.
What we need is separation of removal and reclamation. Without that,
any effort to make things unplug-safe is going to be way way more
complicated than necessary.
Paolo
- [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Liu Ping Fan, 2013/06/25
- [Qemu-devel] [PATCH 1/3] QEMUBH: introduce canceled member for bh, Liu Ping Fan, 2013/06/25
- [Qemu-devel] [PATCH 2/3] QEMUBH: pin bh's referring object while scheduling, Liu Ping Fan, 2013/06/25
- [Qemu-devel] [PATCH 3/3] virtio-net: set referred object for virtio net's bh, Liu Ping Fan, 2013/06/25
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Paolo Bonzini, 2013/06/25
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, liu ping fan, 2013/06/25
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Paolo Bonzini, 2013/06/25
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, liu ping fan, 2013/06/25
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, liu ping fan, 2013/06/26
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Paolo Bonzini, 2013/06/26
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, liu ping fan, 2013/06/26
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Paolo Bonzini, 2013/06/26
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, liu ping fan, 2013/06/26
- Re: [Qemu-devel] [PATCH 0/3] make bh safe with hot-unplug, Paolo Bonzini, 2013/06/27