Skip to contentSkip to conversation

blkback feature announcement

DISCUSSION Jan Beulich 4 participants 8 messages Dec 7, 2015 – Dec 8, 2015

lore
Share & tools
lore
#0 lore raw

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

Or in more general terms: Shouldn't it be well defined at what time a frontend can rely on certain nodes to be available for inspection? And in doing so, I'd expect the determination to be done such that widest flexibility is provided towards the actual implementation, i.e. nodes should be written as early as possible. (Of course this applies to other frontend/backend pairs too.)

Thanks, Jan

#1 lore raw

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

Quoted 6 lines

Or in more general terms: Shouldn't it be well defined at what time a frontend can rely on certain nodes to be available for inspection? And in doing so, I'd expect the determination to be done such that widest flexibility is provided towards the actual implementation, i.e. nodes should be written as early as possible. (Of course this applies to other frontend/backend pairs too.)

I agree. Regarding blkback the nodes about persistent grants, indirect descriptors and the ring page order should be written in xen_blkbk_probe, while the specific information about this virtual disk (sectors, sector size...) should be written before switching to the connected state (ie: after hotplug scripts have run).

Roger.

#2 lore raw
Quoted 2 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 1 line

Hello,

Ccing Bob.

Quoted 24 lines
Quoted 6 lines

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

Quoted 6 lines

Or in more general terms: Shouldn't it be well defined at what time a frontend can rely on certain nodes to be available for inspection? And in doing so, I'd expect the determination to be done such that widest flexibility is provided towards the actual implementation, i.e. nodes should be written as early as possible. (Of course this applies to other frontend/backend pairs too.)

I agree. Regarding blkback the nodes about persistent grants, indirect descriptors and the ring page order should be written in xen_blkbk_probe, while the specific information about this virtual disk (sectors, sector size...) should be written before switching to the connected state (ie: after hotplug scripts have run).

Roger.

#3 lore raw
In reply to Roger Pau Monné
Quoted 11 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

AFAIR, that's for the blkfront resume path.

We need to get the "max-ring-page-order" in blkfront_resume() in advance, so that we can know how many ring pages to be used before setup_blkring().

Bob.

Quoted 15 lines
Quoted 6 lines

Or in more general terms: Shouldn't it be well defined at what time a frontend can rely on certain nodes to be available for inspection? And in doing so, I'd expect the determination to be done such that widest flexibility is provided towards the actual implementation, i.e. nodes should be written as early as possible. (Of course this applies to other frontend/backend pairs too.)

I agree. Regarding blkback the nodes about persistent grants, indirect descriptors and the ring page order should be written in xen_blkbk_probe, while the specific information about this virtual disk (sectors, sector size...) should be written before switching to the connected state (ie: after hotplug scripts have run).

Roger.

#4 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 02:08, <[email protected]> wrote:
Quoted 9 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

Quoted 7 lines
Quoted 2 lines

No, AFAIK there's no specific reason.

AFAIR, that's for the blkfront resume path.

We need to get the "max-ring-page-order" in blkfront_resume() in advance, so that we can know how many ring pages to be used before setup_blkring().

I don't follow - the proposal is to have the backend announce the feature _earlier_, so how could frontend resume be affected?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 14 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 02:08, <[email protected]> wrote:
Quoted 11 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

Quoted 8 lines
Quoted 4 lines

AFAIR, that's for the blkfront resume path.

We need to get the "max-ring-page-order" in blkfront_resume() in advance, so that we can know how many ring pages to be used before setup_blkring().

I don't follow - the proposal is to have the backend announce the feature _earlier_, so how could frontend resume be affected?

The frontend resume is like this:

blkfront_resume()

     > blkif_free()
     > talk_to_blkback()
         > setup_blkring() etc.

blkback_changed()
> blkfront_connect()

Sometimes the "max-ring-page-order" of backend may have changed after the guest(frontend) migrated to a different machine, the frontend must aware of this change so that have to get the new value of "max-ring-page-order" in blkfront_resume().

But it would be too late if the backend announces the "max-ring-page-order" in connect(), this situation is like:

blkfront_resume()
> blkif_free()
> talk_to_blkback()
^^^ Get a wrong "max-ring-page-order"
> setup_blkring() etc. but using the wrong value!!

blkback_changed()
> blkfront_connect()
^^^ Then the connect() in backend will be called(after frontend enter XenbusStateConnected) and write the correct "max-ring-page-order", but it's too late.

Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 52 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 12:06, <[email protected]> wrote:
Quoted 14 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 02:08, <[email protected]> wrote:
Quoted 11 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

Quoted 9 lines
Quoted 5 lines

AFAIR, that's for the blkfront resume path.

We need to get the "max-ring-page-order" in blkfront_resume() in advance, so

that we can know how many ring pages to be used before setup_blkring().

I don't follow - the proposal is to have the backend announce the feature _earlier_, so how could frontend resume be affected?

The frontend resume is like this:

blkfront_resume()

     > blkif_free()
     > talk_to_blkback()
         > setup_blkring() etc.

blkback_changed()
> blkfront_connect()

Sometimes the "max-ring-page-order" of backend may have changed after the guest(frontend) migrated to a different machine,
the frontend must aware of this change so that have to get the new value of "max-ring-page-order" in blkfront_resume().

But it would be too late if the backend announces the "max-ring-page-order" in connect(), this situation is like:

blkfront_resume()
> blkif_free()
> talk_to_blkback()
^^^ Get a wrong "max-ring-page-order"
> setup_blkring() etc. but using the wrong value!!

Quoted 5 lines

blkback_changed()
> blkfront_connect()
^^^ Then the connect() in backend will be called(after frontend enter
XenbusStateConnected) and write the correct "max-ring-page-order", but it's too late.

Oh, you're arguing for why "max-ring-page-order" is written early, but the question really was why others aren't written early too.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
Quoted 52 lines · Jan Beulich
Quoted 52 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 12:06, <[email protected]> wrote:
Quoted 14 lines · Jan Beulich
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 08.12.15 at 02:08, <[email protected]> wrote:
Quoted 11 lines · Roger Pau Monné

El 07/12/15 a les 13.00, Jan Beulich ha escrit:

Quoted 7 lines

Hello,

is there a particular reason why "max-ring-page-order" gets written in xen_blkbk_probe(), but e.g. "feature-max-indirect-segments" and "feature-persistent" get written only in connect(), despite both having constant values (and hence the node value effectively being known as soon as the device exists)?

No, AFAIK there's no specific reason.

Quoted 9 lines
Quoted 5 lines

AFAIR, that's for the blkfront resume path.

We need to get the "max-ring-page-order" in blkfront_resume() in advance, so

that we can know how many ring pages to be used before setup_blkring().

I don't follow - the proposal is to have the backend announce the feature _earlier_, so how could frontend resume be affected?

The frontend resume is like this:

blkfront_resume()

     > blkif_free()
     > talk_to_blkback()
         > setup_blkring() etc.

blkback_changed()
> blkfront_connect()

Sometimes the "max-ring-page-order" of backend may have changed after the guest(frontend) migrated to a different machine,
the frontend must aware of this change so that have to get the new value of "max-ring-page-order" in blkfront_resume().

But it would be too late if the backend announces the "max-ring-page-order" in connect(), this situation is like:

blkfront_resume()
> blkif_free()
> talk_to_blkback()
^^^ Get a wrong "max-ring-page-order"
> setup_blkring() etc. but using the wrong value!!

Quoted 9 lines
Quoted 5 lines

blkback_changed()
> blkfront_connect()
^^^ Then the connect() in backend will be called(after frontend enter
XenbusStateConnected) and write the correct "max-ring-page-order", but it's too late.

Oh, you're arguing for why "max-ring-page-order" is written early, but the question really was why others aren't written early too.

Oh, sorry for misunderstood your point. Yes, I agree that others can be written early too.

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel