From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQxGe-0004Rd-8K for qemu-devel@nongnu.org; Wed, 24 Oct 2012 05:28:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQxGQ-00085d-If for qemu-devel@nongnu.org; Wed, 24 Oct 2012 05:28:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQxGQ-00085R-AY for qemu-devel@nongnu.org; Wed, 24 Oct 2012 05:28:38 -0400 Message-ID: <5087B4C2.7040901@redhat.com> Date: Wed, 24 Oct 2012 11:28:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <24E144B8C0207547AD09C467A8259F75576FED43@lisa.maurer-it.com> In-Reply-To: <24E144B8C0207547AD09C467A8259F75576FED43@lisa.maurer-it.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] raltelimit bug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dietmar Maurer Cc: "qemu-devel@nongnu.org" Il 24/10/2012 10:56, Dietmar Maurer ha scritto: > The code to compute slice_quota seems buggy. The following fixes the issue: > > --- new.orig/include/qemu/ratelimit.h 2012-10-22 07:06:31.000000000 +0200 > +++ new/include/qemu/ratelimit.h 2012-10-22 07:06:49.000000000 +0200 > @@ -42,7 +42,7 @@ > uint64_t slice_ns) > { > limit->slice_ns = slice_ns; > - limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns; > + limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL; > } > > #endif Ouch, you're right. The patch that introduced include/qemu/ratelimit.h did: - limit->slice_quota = speed / (1000000000ULL / SLICE_TIME); + limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns; Can you submit the patch with a commit message and Signed-off-by line? Paolo