WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/2] blkback: Read "tokens-refill", and "tokens-max"

To: undisclosed-recipients:;
Subject: [Xen-devel] [PATCH 2/2] blkback: Read "tokens-refill", and "tokens-max" xenstore values to provide QoS parameters per device.
From: William Pitcock <nenolod@xxxxxxxxxxxxxxxx>
Date: Tue, 31 Mar 2009 09:17:05 -0500
Delivery-date: Fri, 01 May 2009 12:07:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <cover.1238509559.git.nenolod@xxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1238509559.git.nenolod@xxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>