From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [blkback] blkback statistic counters are signed values Date: Mon, 4 Mar 2013 14:22:46 -0500 Message-ID: <20130304192246.GH15386@phenom.dumpdata.com> References: <5134C3C2.6040108@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5134C3C2.6040108@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Zoltan Kiss Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, Mar 04, 2013 at 03:54:42PM +0000, Zoltan Kiss wrote: > Hi, > > One of our colleagues spotted a problem in xentop. Sometimes the > VBD_WSECT value suddenly becomes unreasonably high, and it turned > out xentop reads > /sys/bus/xen-backend/devices/vbd-(domid)-(devID)/statistics/wr_sect > into an unsigned long long. That value is exposed by blkback, and > among other stat counters, it's a signed integer: > > drivers/block/xen-blkback/common.h > struct xen_blkif { > ... > int st_rd_req; > int st_wr_req; > int st_oo_req; > int st_f_req; > int st_ds_req; > int st_rd_sect; > int st_wr_sect; > > > I don't think these values should be negative ever, but when they > overflow (which happens eventually), they do, and this leads to bad > conversion in xentop. > I think the best solution would be to change the above mentioned > values to unsigned long long as well. Any comments on that? Seems like the right approach. Could you send a patch please? Thought that won't solve the problem when we overflow an 'unsigned long long'. > > Regards, > > Zoltan Kiss > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >