[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/2] blkback: Read "tokens-refill", and "tokens-max" xenstore values to provide QoS parameters per device.



This patch enables the ability to define a QoS policy for a specific guest. As 
an example,
consider the following vbd table:

vbd = [
   'phy:/dev/skylar/guest1-disk,xvda1:tokens-max=500000:tokens-refill=512,w',
   'phy:/dev/skylar/guest1-swap,xvda2:tokens-max=140000:tokens-refill=128,w',
]

This patch would cause the system to give less credit to accesses for xvda2 than
xvda1, meaning that guests heavily into swap will degrade system performance 
less.

Since the QoS settings are guest specific, each guest can have it's own credit
allotments, which may be considered useful to somebody.

This patch only affects the kernel side, changes to xend will be necessary and
will be covered in another patch against 3.4.

Signed-off-by: William Pitcock <nenolod@xxxxxxxxxxxxxxxx>
---
 drivers/xen/blkback/xenbus.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/xen/blkback/xenbus.c b/drivers/xen/blkback/xenbus.c
index 650f4b3..66357af 100644
--- a/drivers/xen/blkback/xenbus.c
+++ b/drivers/xen/blkback/xenbus.c
@@ -311,6 +311,11 @@ static void backend_changed(struct xenbus_watch *watch,
                kfree(device_type);
        }
 
+       /* gather information about QoS policy for this device. */
+       err = xenbus_gather(XBT_NIL, dev->otherend, "tokens-max", "%d", 
&be->blkif->reqmax,
+               "tokens-refill", "%d", &be->blkif->reqrate, NULL);
+       be->blkif->reqtime = jiffies;
+
        if (be->major == 0 && be->minor == 0) {
                /* Front end dir is a number, which is used as the handle. */
 
-- 
1.6.1.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.