qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] raltelimit bug
@ 2012-10-24  8:56 Dietmar Maurer
  2012-10-24  9:28 ` Paolo Bonzini
  2012-10-24 23:24 ` Eric Blake
  0 siblings, 2 replies; 3+ messages in thread
From: Dietmar Maurer @ 2012-10-24  8:56 UTC (permalink / raw)
  To: pbonzini@redhat.com, qemu-devel@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] raltelimit bug
  2012-10-24  8:56 [Qemu-devel] raltelimit bug Dietmar Maurer
@ 2012-10-24  9:28 ` Paolo Bonzini
  2012-10-24 23:24 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-10-24  9:28 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] raltelimit bug
  2012-10-24  8:56 [Qemu-devel] raltelimit bug Dietmar Maurer
  2012-10-24  9:28 ` Paolo Bonzini
@ 2012-10-24 23:24 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2012-10-24 23:24 UTC (permalink / raw)
  To: Dietmar Maurer; +Cc: pbonzini@redhat.com, qemu-devel@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

On 10/24/2012 02:56 AM, Dietmar Maurer wrote:
> 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

Missing a Signed-off-By, so it cannot be taken as-is.  See
http://wiki.qemu.org/Contribute/SubmitAPatch for hints.

> +++ 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
> 
> 
> 
> 

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-24 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24  8:56 [Qemu-devel] raltelimit bug Dietmar Maurer
2012-10-24  9:28 ` Paolo Bonzini
2012-10-24 23:24 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).