From patchwork Wed Oct 24 08:56:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Maurer X-Patchwork-Id: 194009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3399D2C00A5 for ; Thu, 25 Oct 2012 10:14:07 +1100 (EST) Received: from localhost ([::1]:37568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRA9E-00082P-PF for incoming@patchwork.ozlabs.org; Wed, 24 Oct 2012 19:14:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQwls-000561-EG for qemu-devel@nongnu.org; Wed, 24 Oct 2012 04:57:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQwlm-0006NG-PA for qemu-devel@nongnu.org; Wed, 24 Oct 2012 04:57:04 -0400 Received: from www.maurer-it.com ([213.129.239.114]:38962 helo=proxmox.maurer-it.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQwlm-0006Kz-Gg for qemu-devel@nongnu.org; Wed, 24 Oct 2012 04:56:58 -0400 Received: from proxmox.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox.maurer-it.com (Proxmox) with ESMTP id 5F01826A0912; Wed, 24 Oct 2012 10:56:48 +0200 (CEST) From: Dietmar Maurer To: "pbonzini@redhat.com" , "qemu-devel@nongnu.org" Thread-Topic: raltelimit bug Thread-Index: Ac2xxQXXpQP6RvaeTLO2SOwo4ckC8Q== Date: Wed, 24 Oct 2012 08:56:47 +0000 Message-ID: <24E144B8C0207547AD09C467A8259F75576FED43@lisa.maurer-it.com> Accept-Language: en-US, de-AT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.129.239.114 X-Mailman-Approved-At: Wed, 24 Oct 2012 19:13:49 -0400 Subject: [Qemu-devel] raltelimit bug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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