All of lore.kernel.org
 help / color / mirror / Atom feed
* blkback feature announcement
@ 2015-12-07 12:00 Jan Beulich
  2015-12-07 12:42 ` Roger Pau Monné
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2015-12-07 12:00 UTC (permalink / raw)
  To: Roger Pau Monne, Konrad Rzeszutek Wilk; +Cc: xen-devel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-07 12:00 blkback feature announcement Jan Beulich
@ 2015-12-07 12:42 ` Roger Pau Monné
  2015-12-07 14:54   ` Konrad Rzeszutek Wilk
  2015-12-08  1:08   ` Bob Liu
  0 siblings, 2 replies; 8+ messages in thread
From: Roger Pau Monné @ 2015-12-07 12:42 UTC (permalink / raw)
  To: Jan Beulich, Konrad Rzeszutek Wilk; +Cc: xen-devel

El 07/12/15 a les 13.00, Jan Beulich ha escrit:
> 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.

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-07 12:42 ` Roger Pau Monné
@ 2015-12-07 14:54   ` Konrad Rzeszutek Wilk
  2015-12-08  1:08   ` Bob Liu
  1 sibling, 0 replies; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-12-07 14:54 UTC (permalink / raw)
  To: Roger Pau Monné, bob.liu; +Cc: xen-devel, Jan Beulich

On Mon, Dec 07, 2015 at 01:42:09PM +0100, Roger Pau Monné wrote:
> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
> > Hello,

Ccing Bob.
> > 
> > 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.
> 
> > 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.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-07 12:42 ` Roger Pau Monné
  2015-12-07 14:54   ` Konrad Rzeszutek Wilk
@ 2015-12-08  1:08   ` Bob Liu
  2015-12-08  8:13     ` Jan Beulich
  1 sibling, 1 reply; 8+ messages in thread
From: Bob Liu @ 2015-12-08  1:08 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel, Jan Beulich


On 12/07/2015 08:42 PM, Roger Pau Monné wrote:
> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
>> 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.

>> 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.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-08  1:08   ` Bob Liu
@ 2015-12-08  8:13     ` Jan Beulich
  2015-12-08 11:06       ` Bob Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2015-12-08  8:13 UTC (permalink / raw)
  To: Bob Liu; +Cc: xen-devel, roger.pau

>>> On 08.12.15 at 02:08, <bob.liu@oracle.com> wrote:
> On 12/07/2015 08:42 PM, Roger Pau Monné wrote:
>> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
>>> 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().

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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-08  8:13     ` Jan Beulich
@ 2015-12-08 11:06       ` Bob Liu
  2015-12-08 11:13         ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Bob Liu @ 2015-12-08 11:06 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, roger.pau


On 12/08/2015 04:13 PM, Jan Beulich wrote:
>>>> On 08.12.15 at 02:08, <bob.liu@oracle.com> wrote:
>> On 12/07/2015 08:42 PM, Roger Pau Monné wrote:
>>> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
>>>> 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().
> 
> 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-08 11:06       ` Bob Liu
@ 2015-12-08 11:13         ` Jan Beulich
  2015-12-08 11:20           ` Bob Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2015-12-08 11:13 UTC (permalink / raw)
  To: Bob Liu; +Cc: xen-devel, roger.pau

>>> On 08.12.15 at 12:06, <bob.liu@oracle.com> wrote:

> On 12/08/2015 04:13 PM, Jan Beulich wrote:
>>>>> On 08.12.15 at 02:08, <bob.liu@oracle.com> wrote:
>>> On 12/07/2015 08:42 PM, Roger Pau Monné wrote:
>>>> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
>>>>> 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().
>> 
>> 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.

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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: blkback feature announcement
  2015-12-08 11:13         ` Jan Beulich
@ 2015-12-08 11:20           ` Bob Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Bob Liu @ 2015-12-08 11:20 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, roger.pau


On 12/08/2015 07:13 PM, Jan Beulich wrote:
>>>> On 08.12.15 at 12:06, <bob.liu@oracle.com> wrote:
> 
>> On 12/08/2015 04:13 PM, Jan Beulich wrote:
>>>>>> On 08.12.15 at 02:08, <bob.liu@oracle.com> wrote:
>>>> On 12/07/2015 08:42 PM, Roger Pau Monné wrote:
>>>>> El 07/12/15 a les 13.00, Jan Beulich ha escrit:
>>>>>> 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().
>>>
>>> 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.
> 
> 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.

-- 
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-08 11:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 12:00 blkback feature announcement Jan Beulich
2015-12-07 12:42 ` Roger Pau Monné
2015-12-07 14:54   ` Konrad Rzeszutek Wilk
2015-12-08  1:08   ` Bob Liu
2015-12-08  8:13     ` Jan Beulich
2015-12-08 11:06       ` Bob Liu
2015-12-08 11:13         ` Jan Beulich
2015-12-08 11:20           ` Bob Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.