All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Francesco Romani <fromani@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, stefanha@redhat.com,
	lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4] block: add event when disk usage exceeds threshold
Date: Fri, 09 Jan 2015 09:54:40 -0700	[thread overview]
Message-ID: <54B007D0.9050109@redhat.com> (raw)
In-Reply-To: <1417683548-15845-1-git-send-email-fromani@redhat.com>

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

On 12/04/2014 01:59 AM, Francesco Romani wrote:
> Managing applications, like oVirt (http://www.ovirt.org), make extensive
> use of thin-provisioned disk images.
> To let the guest run smoothly and be not unnecessarily paused, oVirt sets
> a disk usage threshold (so called 'high water mark') based on the occupation
> of the device,  and automatically extends the image once the threshold
> is reached or exceeded.
> 
> In order to detect the crossing of the threshold, oVirt has no choice but
> aggressively polling the QEMU monitor using the query-blockstats command.
> This lead to unnecessary system load, and is made even worse under scale:
> deployments with hundreds of VMs are no longer rare.
> 
> To fix this, this patch adds:
> * A new monitor command to set a write threshold for a given block device.
> * A new event to report if a block device usage exceeds the threshold.

Please also mention the names of those two things in the commit message,
to make it easier to find them when doing 'git log' archaeology.

> 
> This will allow the managing application to use smarter and more
> efficient monitoring, greatly reducing the need of polling.
> 
> A followup patch is planned to allow to add the write threshold at
> device creation.
> 
> Signed-off-by: Francesco Romani <fromani@redhat.com>
> ---

> --- /dev/null
> +++ b/block/write-threshold.c
> @@ -0,0 +1,125 @@
> +/*
> + * QEMU System Emulator block write threshold notification
> + *
> + * Copyright Red Hat, Inc. 2014

I've been so slow on the review that you may want to add 2015.


> +bool bdrv_write_threshold_is_set(const BlockDriverState *bs)
> +{
> +    return !!(bs->write_threshold_offset > 0);

The !! is spurious; use of > already guarantees a bool result.

> +++ b/qapi/block-core.json
> @@ -239,6 +239,9 @@
>  #
>  # @iops_size: #optional an I/O size in bytes (Since 1.7)
>  #
> +# @write_threshold: configured write threshold for the device.
> +#                   0 if disabled. (Since 2.3)
> +#
>  # Since: 0.14.0
>  #
>  ##
> @@ -253,7 +256,7 @@
>              '*bps_max': 'int', '*bps_rd_max': 'int',
>              '*bps_wr_max': 'int', '*iops_max': 'int',
>              '*iops_rd_max': 'int', '*iops_wr_max': 'int',
> -            '*iops_size': 'int' } }
> +            '*iops_size': 'int', 'write_threshold': 'uint64' } }

'int' works as well as 'uint64'; since this is an output parameter, we
aren't gaining any stricter input parsing by using a more-specific type.

My findings are minor, so I'm okay if you post a v5 that addresses them
and includes:
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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: 604 bytes --]

  parent reply	other threads:[~2015-01-09 16:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  8:59 [Qemu-devel] [PATCH v4] block: add event when disk usage exceeds threshold Francesco Romani
2014-12-04  9:00 ` Francesco Romani
2014-12-15 11:19   ` Francesco Romani
2015-01-09 10:36     ` Francesco Romani
2015-01-09 16:54 ` Eric Blake [this message]
2015-01-12 10:54   ` 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=54B007D0.9050109@redhat.com \
    --to=eblake@redhat.com \
    --cc=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.