Skip to contentSkip to conversation

xen: blkif.h: document linux xen-block multi-page ring implementation

PATCH In review Bob Liu 6 participants 10 messages May 12, 2015 – May 15, 2015

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 xen: blkif.h: document linux xen-block multi-page ring implementation

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

---
 xen/include/public/io/blkif.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
xen/include/public/io/blkif.h +6 -6
index 6baf7fb..0e34ae6 100644
@@ -189,11 +189,11 @@
  *
  * max-ring-pages
  *      Values:         <uint32_t>
- *      Default Value:  1
- *      Notes:          DEPRECATED, 2, 3
+ *      Default Value:  32
+ *      Notes:          2, 3
  *
  *      The maximum supported size of the request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  *------------------------- Backend Device Properties -------------------------
  *
@@ -302,11 +302,11 @@
  * num-ring-pages
  *      Values:         <uint32_t>
  *      Default Value:  1
- *      Maximum Value:  MAX(max-ring-pages,(0x1 << max-ring-page-order))
- *      Notes:          DEPRECATED, 2, 3
+ *      Maximum Value:  max-ring-pages
+ *      Notes:          2, 3
  *
  *      The size of the frontend allocated request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  * feature-persistent
  *      Values:         0/1 (boolean)
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw

El 12/05/15 a les 12.58, Bob Liu ha escrit:

Quoted 7 lines

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

Quoted 5 lines

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

This looks fine IMHO, the only caveat I see is that you are revamping an old feature so we need to be careful that the implementation that's merged on Linux is compatible with the previous implementation.

Roger.

#2 lore raw
In reply to Bob Liu
Quoted 10 lines · Bob Liu

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

You can't drop the power of 2 restriction as there may be frontends that support this old option (from before it was deprecated) and these may not support non-powers of 2.

David

author
#3 lore raw
Quoted 8 lines · David Vrabel
Quoted 7 lines · Bob Liu

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

Quoted 8 lines
Quoted 3 lines

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

You can't drop the power of 2 restriction as there may be frontends that support this old option (from before it was deprecated) and these may not support non-powers of 2.

After take a closer look I think we can fully reuse the current protocol which only uses 'ring-page-order' and 'max-ring-page-order'.
And leave 'max-ring-pages' and 'num-ring-pages' to DEPRECATED.

In conclusion, the blkif.h don't need to be modified and I'll update Linux implementation to use 'ring-page-order' and 'max-ring-page-order' too. What do you think? Thank you!

Regards,
-Bob

#4 lore raw
Quoted 19 lines · Bob Liu
Quoted 8 lines · David Vrabel
Quoted 7 lines · Bob Liu

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

Quoted 8 lines
Quoted 3 lines

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

You can't drop the power of 2 restriction as there may be frontends that support this old option (from before it was deprecated) and these may not support non-powers of 2.

Quoted 7 lines

After take a closer look I think we can fully reuse the current protocol which only uses 'ring-page-order' and 'max-ring-page-order'.
And leave 'max-ring-pages' and 'num-ring-pages' to DEPRECATED.

In conclusion, the blkif.h don't need to be modified and I'll update Linux implementation to use 'ring-page-order' and 'max-ring-page-order' too. What do you think? Thank you!

This sounds fine.

David

#5 lore raw
In reply to Bob Liu
Quoted 10 lines · Bob Liu

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using multi-page ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-pages' and 'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value accordingly.

Doing an git annotate shows:

commit 829f2a9c6dfae13faee4e24b953441113338e0f2

Author: Justin T. Gibbs <[email protected]>
Date:   Thu Feb 23 10:02:30 2012 +0000

blkif.h: Document the Red Hat and Citrix blkif multi-page ring extensions

No functional changes.

Which says:

* (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ * PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ * including a distribution deployed on certain nodes of the Amazon
+ * EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ * in slightly different forms, by both Citrix and RedHat/Amazon.

And I double checked the linux-2.6.18.hg tree and I see no mention of multi-page. I wonder where such code exists?

CC-ing Matt, perhaps he can help.

Cc-ing Paul, perhaps he can help with the Citrix part.

Thank you!

P.S.
Also added Keir on the 'To' as scripts/get_maintainers.pl says he should be on it.

Quoted 43 lines
---
 xen/include/public/io/blkif.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
xen/include/public/io/blkif.h +6 -6
index 6baf7fb..0e34ae6 100644
@@ -189,11 +189,11 @@
  *
  * max-ring-pages
  *      Values:         <uint32_t>
- *      Default Value:  1
- *      Notes:          DEPRECATED, 2, 3
+ *      Default Value:  32
+ *      Notes:          2, 3
  *
  *      The maximum supported size of the request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  *------------------------- Backend Device Properties -------------------------
  *
@@ -302,11 +302,11 @@
  * num-ring-pages
  *      Values:         <uint32_t>
  *      Default Value:  1
- *      Maximum Value:  MAX(max-ring-pages,(0x1 << max-ring-page-order))
- *      Notes:          DEPRECATED, 2, 3
+ *      Maximum Value:  max-ring-pages
+ *      Notes:          2, 3
  *
  *      The size of the frontend allocated request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  * feature-persistent
  *      Values:         0/1 (boolean)
Signature · 1 line
1.7.10.4
#6 lore raw
Quoted 46 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 15 May 2015 16:23
To: Bob Liu; [email protected]; Paul Durrant; Keir (Xen.org)
Cc: [email protected]; David Vrabel; [email protected]; Roger Pau Monne
Subject: Re: [PATCH] xen: blkif.h: document linux xen-block multi-page ring implementation

Quoted 4 lines · Bob Liu

After commit 1b1586eeeb8c ("xenbus_client: Extend interface to support multi-page ring"), Linux xenbus driver can support multi-page ring.

Based on this interface, we got some impressive improvements by using

multi-page

Quoted 4 lines

ring in xen-block driver. If using 64 pages as the ring, the IOPS increased about 15 times for the throughput testing.

The Linux implementation reuses two 'DEPRECATED' nodes('max-ring-

pages' and

Quoted 2 lines

'num-ring-pages), so that nothing would be broken.
Also removed the power of 2 limit and updated the default/max value

accordingly.

Doing an git annotate shows:

commit 829f2a9c6dfae13faee4e24b953441113338e0f2

Author: Justin T. Gibbs <[email protected]>
Date:   Thu Feb 23 10:02:30 2012 +0000

blkif.h: Document the Red Hat and Citrix blkif multi-page ring extensions

No functional changes.

Which says:

* (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ * PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ * including a distribution deployed on certain nodes of the Amazon
+ * EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ * in slightly different forms, by both Citrix and RedHat/Amazon.

Quoted 7 lines

And I double checked the linux-2.6.18.hg tree and I see no mention of multi-page. I wonder where such code exists?

CC-ing Matt, perhaps he can help.

Cc-ing Paul, perhaps he can help with the Citrix part.

The only code that has ever been deployed by Citrix, to my knowledge, is the Windows multi-page frontend code which uses the 'page-order' variants of the xenstore keys. I don't believe Citrix has ever shipped capable backends in XenServer, but it's possible Amazon implemented such a thing since they use Citrix drivers in their Windows guests.

Paul

Quoted 50 lines

Thank you!

P.S.
Also added Keir on the 'To' as scripts/get_maintainers.pl says he should be on it.

Quoted 26 lines
---
 xen/include/public/io/blkif.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
xen/include/public/io/blkif.h +3 -3
index 6baf7fb..0e34ae6 100644
@@ -189,11 +189,11 @@
  *
  * max-ring-pages
  *      Values:         <uint32_t>
- *      Default Value:  1
- *      Notes:          DEPRECATED, 2, 3
+ *      Default Value:  32
+ *      Notes:          2, 3
  *
  *      The maximum supported size of the request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  *------------------------- Backend Device Properties -------------------------
  *

xen/include/public/io/blkif.h line 305

Quoted 4 lines
xen/include/public/io/blkif.h +0 -1
@@ -302,11 +302,11 @@
  * num-ring-pages
  *      Values:         <uint32_t>
  *      Default Value:  1
- *      Maximum Value:  MAX(max-ring-pages,(0x1 << max-ring-page-

order))

Quoted 13 lines
xen/include/public/io/blkif.h +3 -3
- *      Notes:          DEPRECATED, 2, 3
+ *      Maximum Value:  max-ring-pages
+ *      Notes:          2, 3
  *
  *      The size of the frontend allocated request ring buffer in units of
- *      machine pages.  The value must be a power of 2.
+ *      machine pages.
  *
  * feature-persistent
  *      Values:         0/1 (boolean)
--

1.7.10.4

#7 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 15.05.15 at 17:22, <[email protected]> wrote:

Doing an git annotate shows:

commit 829f2a9c6dfae13faee4e24b953441113338e0f2

Author: Justin T. Gibbs <[email protected]>
Date:   Thu Feb 23 10:02:30 2012 +0000

blkif.h: Document the Red Hat and Citrix blkif multi-page ring extensions

No functional changes.

Which says:

* (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ * PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ * including a distribution deployed on certain nodes of the Amazon
+ * EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ * in slightly different forms, by both Citrix and RedHat/Amazon.

Quoted 2 lines

And I double checked the linux-2.6.18.hg tree and I see no mention of multi-page. I wonder where such code exists?

We have support for multi page rings in our kernels, largely because (iirc) Amazon had asked it.

Jan

#8 lore raw
Quoted 23 lines · Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 15.05.15 at 17:22, <[email protected]> wrote:

Doing an git annotate shows:

commit 829f2a9c6dfae13faee4e24b953441113338e0f2

Author: Justin T. Gibbs <[email protected]>
Date:   Thu Feb 23 10:02:30 2012 +0000

blkif.h: Document the Red Hat and Citrix blkif multi-page ring extensions

No functional changes.

Which says:

* (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ * PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ * including a distribution deployed on certain nodes of the Amazon
+ * EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ * in slightly different forms, by both Citrix and RedHat/Amazon.

Quoted 5 lines
Quoted 2 lines

And I double checked the linux-2.6.18.hg tree and I see no mention of multi-page. I wonder where such code exists?

We have support for multi page rings in our kernels, largely because (iirc) Amazon had asked it.

Aha!

Bob has found that he can use 'ring-page-order' and 'max-ring-page-order' which are the new standard and not have to worry about breaking older guests.

Quoted 3 lines

Jan

#9 lore raw
Quoted 40 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 15 May 2015 16:55
To: Jan Beulich
Cc: Bob Liu; [email protected]; David Vrabel; Paul Durrant; Roger Pau Monne; [email protected]; [email protected]; Keir (Xen.org)
Subject: Re: [Xen-devel] [PATCH] xen: blkif.h: document linux xen-block multi-page ring implementation

Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.05.15 at 17:22, <[email protected]> wrote:

Doing an git annotate shows:

commit 829f2a9c6dfae13faee4e24b953441113338e0f2

Author: Justin T. Gibbs <[email protected]>
Date:   Thu Feb 23 10:02:30 2012 +0000

blkif.h: Document the Red Hat and Citrix blkif multi-page ring

extensions

Quoted 7 lines
Quoted 7 lines

No functional changes.

Which says:

* (1) Multi-page ring buffer scheme first developed in the Citrix

XenServer

Quoted 2 lines
Quoted 2 lines

+ * PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat

distributions

Quoted 3 lines
Quoted 3 lines

+ * including a distribution deployed on certain nodes of the Amazon
+ * EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented

independently,

Quoted 6 lines
Quoted 5 lines

+ * in slightly different forms, by both Citrix and RedHat/Amazon.

And I double checked the linux-2.6.18.hg tree and I see no mention of multi-page. I wonder where such code exists?

Quoted 8 lines
Quoted 2 lines

We have support for multi page rings in our kernels, largely because (iirc) Amazon had asked it.

Aha!

Bob has found that he can use 'ring-page-order' and 'max-ring-page-order' which are the new standard and not have to worry about breaking older guests.

The Xen Project Windows drivers use those keys too: see http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/blockring.c;h=35ffb3b39d1478f08fbe016f992de152a494c0e1;hb=HEAD

Paul

Quoted 3 lines
Quoted 3 lines

Jan