All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@nodalink.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Benoît Canet" <benoit.canet@nodalink.com>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] timers: Move NANOSECONDS_PER_SECONDS to timer.h for future reuse
Date: Fri, 5 Sep 2014 14:53:18 +0000	[thread overview]
Message-ID: <20140905145318.GA18866@nodalink.com> (raw)
In-Reply-To: <CAFEAcA_7ckugNPN8taSWkiPGp2vsg=gs_BnYKRPupqPSF7hL6A@mail.gmail.com>

On Fri, Sep 05, 2014 at 03:31:16PM +0100, Peter Maydell wrote:
> On 5 September 2014 15:21, Benoît Canet <benoit.canet@nodalink.com> wrote:
> > Signed-off-by: Benoît Canet <benoit.canet@nodalink.com>
> > ---
> >  include/qemu/throttle.h | 2 --
> >  include/qemu/timer.h    | 2 ++
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
> > index b890613..1c639d2 100644
> > --- a/include/qemu/throttle.h
> > +++ b/include/qemu/throttle.h
> > @@ -27,8 +27,6 @@
> >  #include "qemu-common.h"
> >  #include "qemu/timer.h"
> >
> > -#define NANOSECONDS_PER_SECOND  1000000000.0
> > -
> >  typedef enum {
> >      THROTTLE_BPS_TOTAL,
> >      THROTTLE_BPS_READ,
> > diff --git a/include/qemu/timer.h b/include/qemu/timer.h
> > index 5f5210d..70ce891 100644
> > --- a/include/qemu/timer.h
> > +++ b/include/qemu/timer.h
> > @@ -5,6 +5,8 @@
> >  #include "qemu-common.h"
> >  #include "qemu/notify.h"
> >
> > +#define NANOSECONDS_PER_SECOND  1000000000.0
> 
> I was slightly surprised to see this was a floating
> point constant rather than an integer. I wonder if
> we'll get bitten by that in future...

The origin is the throttle code which does a lot of computation on double.
I'll check if throttle works fine with this constants as an integer.

Best regards

Benoît

> 
> -- PMM

  reply	other threads:[~2014-09-05 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 14:21 [Qemu-devel] [PATCH 0/2] Add the infrastructure that will be used to compute I/O accouting averages Benoît Canet
2014-09-05 14:21 ` [Qemu-devel] [PATCH 1/2] timers: Move NANOSECONDS_PER_SECONDS to timer.h for future reuse Benoît Canet
2014-09-05 14:31   ` Peter Maydell
2014-09-05 14:53     ` Benoît Canet [this message]
2014-09-05 14:21 ` [Qemu-devel] [PATCH 2/2] util: Add an utility infrastructure used to compute an average on a time slice Benoît Canet
2014-09-05 14:55   ` Eric Blake
2014-09-05 15:26     ` Benoît Canet

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=20140905145318.GA18866@nodalink.com \
    --to=benoit.canet@nodalink.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.