Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1449434
| From | Bob Liu <bob.liu@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources |
| Date | 2016-07-25 13:10 +0200 |
| Message-ID | <rYLVL-3Rb-11@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <rXH7P-5hk-3@gated-at.bofh.it> <rXQXv-3f8-1@gated-at.bofh.it> <rYKmZ-2Pk-11@gated-at.bofh.it> <rYLj4-3oK-7@gated-at.bofh.it> <rYLM5-3yP-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/25/2016 06:53 PM, Roger Pau Monné wrote:
..[snip..]
>>>> * We get the device lock and blk_mq_freeze_queue() in dynamic_reconfig_device(),
>>>> and then have to release in blkif_recover() asynchronously which makes the code more difficult to readable.
>>>
>>> I'm not sure I'm following here, do you mean that you will pick the lock in
>>> dynamic_reconfig_device and release it in blkif_recover? Why wouldn't you
>>
>> Yes.
>>
>>> release the lock in dynamic_reconfig_device after doing whatever is needed?
>>>
>>
>> Both 'dynamic configuration' and migration:xenbus_dev_resume() use { blkfront_resume(); blkif_recover() } and depends on the change of xbdev->state.
>> If they happen simultaneously, the State machine of xbdev->state is going to be a mess and very difficult to track.
>>
>> The lock(actually a mutex) is like a big lock to make sure no race would happen at all.
>
> So the only thing that you should do is set the frontend state to closed and
> wait for the backend to also switch to state closed, and then switch the
> frontend state to init again in order to trigger a reconnection.
>
But if migration:xenbus_dev_resume() is triggered at the same time, any state be set might be changed.
=====
E.g
Dynamic_reconfig_device: Migration:xenbus_dev_resume()
Set the frontend state to closed
^^^^
frontend state will be reset to XenbusStateInitialising by xenbus_dev_resume()
Wait for the backend to also switch to state closed
=====
Similar situation may happen at any other place regarding set the state.
> You are right that all this process depends on the state being updated
> correctly, but I don't see how's that different from a normal connection or
> resume, and we don't seem to have races there.
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] xen-blkfront: fix places not updated after introducing 64KB page granularity Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
[PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 11:00 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-21 12:10 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 09:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-22 10:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 11:40 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-22 11:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-22 13:50 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-23 00:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 11:30 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 12:30 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 13:00 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 13:10 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Roger Pau Monné <roger.pau@citrix.com> - 2016-07-25 14:20 +0200
Re: [PATCH 3/3] xen-blkfront: dynamic configuration of per-vbd resources Bob Liu <bob.liu@oracle.com> - 2016-07-25 14:30 +0200
[PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Bob Liu <bob.liu@oracle.com> - 2016-07-15 11:40 +0200
Re: [PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 10:30 +0200
Re: [PATCH 2/3] xen-blkfront: introduce blkif_set_queue_limits() Bob Liu <bob.liu@oracle.com> - 2016-07-21 11:50 +0200
Re: [PATCH 1/3] xen-blkfront: fix places not updated after introducing 64KB page granularity Roger Pau Monné <roger.pau@citrix.com> - 2016-07-21 10:10 +0200
csiph-web