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

RE: [Xen-devel] xenbus stress testing

To: "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] xenbus stress testing
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Fri, 18 Feb 2011 09:17:31 +1100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 17 Feb 2011 14:18:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19805.29093.996401.185391@xxxxxxxxxxxxxxxxxxxxxxxx>
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: <AEC6C66638C05B468B556EA548C1A77D01C556B6@trantor> <19805.29093.996401.185391@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvO1cfj7ueprEy0SJW3CIDfm7Tm0QAGgsHA
Thread-topic: [Xen-devel] xenbus stress testing
> 
> James Harper writes ("[Xen-devel] xenbus stress testing"):
> > Is there a simple way to stress test xenbus from DomU? In
particular,
> > the sending of partial messages.
> 
> Not without messing with the domU kernel.  The xenbus driver in the
> domU kernel is responsible for actually formatting the messages to
> and/from the xenstore shared ring; domU userland if it talks to
> xenstore at all just talks to its kernel.
> 

I think I have found the error and it was probably a 1 in a million race
so stress testing might not have helped anyway. My code went:

len = min(ring->rsp_prod - ring->rsp_cons, msg_size)

and the ASSERT was hit because len was > msg_size, and the only possible
way I can ever see that happening is if ring->rsp_prod changed between
the if in the min() and the assignment. I'm now snapshotting rsp_prod to
a local variable at the start. Kind of embarrassing really as plenty of
example code exists.

For vif and vbd that sort of race would easily be hit fairly often but
xenbus is obviously used much less, I've only ever had one bug report
from it.

James

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