From: Paolo Bonzini <pbonzini@redhat.com>
To: Dietmar Maurer <dietmar@proxmox.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] raltelimit bug
Date: Wed, 24 Oct 2012 11:28:34 +0200 [thread overview]
Message-ID: <5087B4C2.7040901@redhat.com> (raw)
In-Reply-To: <24E144B8C0207547AD09C467A8259F75576FED43@lisa.maurer-it.com>
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
next prev parent reply other threads:[~2012-10-24 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 8:56 [Qemu-devel] raltelimit bug Dietmar Maurer
2012-10-24 9:28 ` Paolo Bonzini [this message]
2012-10-24 23:24 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5087B4C2.7040901@redhat.com \
--to=pbonzini@redhat.com \
--cc=dietmar@proxmox.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.