From: Francesco Romani <fromani@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
lcapitulino@redhat.com, mdroth@linux.vnet.ibm.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: add watermark event
Date: Fri, 8 Aug 2014 04:01:19 -0400 (EDT) [thread overview]
Message-ID: <1841263794.17835817.1407484879020.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20140805130846.GA12251@stefanha-thinkpad.redhat.com>
----- Original Message -----
> From: "Stefan Hajnoczi" <stefanha@redhat.com>
> To: "Kevin Wolf" <kwolf@redhat.com>
> Cc: mdroth@linux.vnet.ibm.com, "Francesco Romani" <fromani@redhat.com>, qemu-devel@nongnu.org, lcapitulino@redhat.com
> Sent: Tuesday, August 5, 2014 3:08:46 PM
> Subject: Re: [Qemu-devel] [PATCH] block: add watermark event
>
> On Tue, Aug 05, 2014 at 10:47:57AM +0200, Kevin Wolf wrote:
> > Am 01.08.2014 um 13:39 hat Stefan Hajnoczi geschrieben:
> > > On Tue, Jul 08, 2014 at 04:49:24PM +0200, Francesco Romani wrote:
> > > > @@ -5813,3 +5815,57 @@ void bdrv_flush_io_queue(BlockDriverState *bs)
> > > > bdrv_flush_io_queue(bs->file);
> > > > }
> > > > }
> > > > +
> > > > +static bool watermark_exceeded(BlockDriverState *bs,
> > > > + int64_t sector_num,
> > > > + int nb_sectors)
> > > > +{
> > > > +
> > > > + if (bs->wr_watermark_perc > 0) {
> > > > + int64_t watermark = (bs->total_sectors) / 100 *
> > > > bs->wr_watermark_perc;
> > >
> > > bs->total_sectors should not be used directly.
> > >
> > > Have you considered making the watermark parameter take sector units
> > > instead of a percentage?
> > >
> > > I'm not sure whether a precentage makes sense because 25% of a 10GB
> > > image is 2.5 GB so a 75% watermark might be reasonable. 25% of a 1 TB
> > > image is 250 GB and that's probably not a reasonable watermark.
> > >
> > > So let the block-set-watermark caller pass an absolute sector number
> > > instead. It keeps things simple for both QEMU and thin provisioning
> > > manager.
> >
> > No sector numbers in external interfaces, please. These units of 512
> > bytes are completely arbitrary and don't make any sense. I hope to get
> > rid of BDRV_SECTOR_* eventually even internally.
> >
> > So for external APIs, please use bytes instead.
>
> I agree and forgot about that. Please use bytes instead of sectors or a
> percentage.
>
Thanks everyone for the great feedback received!
I'll post asap a new patch addressing all the comments.
I'll also change the name because 'watermark' may be misleading/wrong jargon :)
(http://en.wikipedia.org/wiki/Watermark)
Bests,
--
Francesco Romani
RedHat Engineering Virtualization R & D
Phone: 8261328
IRC: fromani
next prev parent reply other threads:[~2014-08-08 8:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 14:49 [Qemu-devel] [PATCH] add watermark reporting for block devices Francesco Romani
2014-07-08 14:49 ` [Qemu-devel] [PATCH] block: add watermark event Francesco Romani
2014-07-08 15:10 ` Eric Blake
2014-08-01 11:39 ` Stefan Hajnoczi
2014-08-05 8:47 ` Kevin Wolf
2014-08-05 13:08 ` Stefan Hajnoczi
2014-08-08 8:01 ` Francesco Romani [this message]
2014-08-08 12:51 ` Eric Blake
2014-07-08 14:51 ` [Qemu-devel] [RFC] add watermark reporting for block devices Francesco Romani
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=1841263794.17835817.1407484879020.JavaMail.zimbra@redhat.com \
--to=fromani@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--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.