From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Igor Redko <redkoi@virtuozzo.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] virtio-balloon: export all balloon statistics
Date: Mon, 22 Feb 2016 14:27:19 -0700 [thread overview]
Message-ID: <56CB7D37.6080704@redhat.com> (raw)
In-Reply-To: <1455954883-28858-2-git-send-email-den@openvz.org>
[-- Attachment #1: Type: text/plain, Size: 2248 bytes --]
On 02/20/2016 12:54 AM, Denis V. Lunev wrote:
> From: Igor Redko <redkoi@virtuozzo.com>
>
> We are making experiments with different autoballooning strategies
> based on the guest behavior. Thus we need to experiment with different
> guest statistics. For now every counter change requires QEMU recompilation
> and dances with Libvirt.
>
> This patch introduces transport for unrecognized counters in virtio-balloon.
> This transport can be used for measuring benefits from using new
> balloon counters, before submitting any patches. Current alternative
> is 'guest-exec' transport which isn't made for such delicate matters
> and can influence test results.
>
> Originally all counters with tag >= VIRTIO_BALLOON_S_NR were ignored.
> Instead of this we keep first (VIRTIO_BALLOON_S_NR + 32) counters from the
> queue and pass unrecognized ones with the following names: 'x-stat-XXXX',
> where XXXX is a tag number in hex. Defined counters are reported with their
> regular names.
The name implies experimental, so apps like libvirt shouldn't rely on
it; while it does fill a gap for making development easier, so I'm in
favor of the idea.
> @@ -133,12 +132,20 @@ static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name,
> if (err) {
> goto out_end;
> }
> - for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
> - visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], &err);
> + for (i = 0; !err && i < s->stats_cnt; i++) {
Why are you checking for err here? You cannot enter the loop with err
set...
> + if (s->stats[i].tag < VIRTIO_BALLOON_S_NR) {
> + visit_type_uint64(v, balloon_stat_names[s->stats[i].tag],
> + &s->stats[i].val, &err);
> + } else {
> + gchar *str = g_strdup_printf("x-stat-%04x", s->stats[i].tag);
> + visit_type_uint64(v, str, &s->stats[i].val, &err);
> + g_free(str);
> + }
> if (err) {
> break;
> }
...and you cannot exit the loop with it set. Therefore the check is dead
code.
--
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 --]
next prev parent reply other threads:[~2016-02-22 21:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-20 7:54 [Qemu-devel] [PATCH 0/2] virtio-balloon: improve balloon statistics Denis V. Lunev
2016-02-20 7:54 ` [Qemu-devel] [PATCH 1/2] virtio-balloon: export all " Denis V. Lunev
2016-02-22 21:27 ` Eric Blake [this message]
2016-02-20 7:54 ` [Qemu-devel] [PATCH 2/2] virtio-balloon: add 'available' counter Denis V. Lunev
2016-02-22 21:28 ` Eric Blake
-- strict thread matches above, loose matches on Subject: below --
2016-02-23 14:59 [Qemu-devel] [PATCH v2 0/2] virtio-balloon: improve balloon statistics Denis V. Lunev
2016-02-23 14:59 ` [Qemu-devel] [PATCH 1/2] virtio-balloon: export all " Denis V. Lunev
2016-02-23 15:24 ` Michael S. Tsirkin
2016-02-23 15:29 ` Denis V. Lunev
2016-02-23 15:49 ` Michael S. Tsirkin
2016-02-24 10:01 ` Roman Kagan
2016-02-24 14:31 ` Michael S. Tsirkin
2016-02-24 15:43 ` Eric Blake
2016-02-25 5:50 ` Denis V. Lunev
2016-02-25 8:44 ` Markus Armbruster
2016-02-25 8:54 ` Michael S. Tsirkin
2016-02-25 9:30 ` Roman Kagan
2016-02-25 10:05 ` Michael S. Tsirkin
2016-02-25 10:46 ` Markus Armbruster
2016-02-25 11:17 ` Roman Kagan
2016-02-25 11:58 ` Markus Armbruster
2016-02-25 12:44 ` Roman Kagan
2016-02-25 14:10 ` Markus Armbruster
2016-02-25 14:49 ` Roman Kagan
2016-02-24 7:50 [Qemu-devel] [PATCH v3 0/2] virtio-balloon: improve " Denis V. Lunev
2016-02-24 7:50 ` [Qemu-devel] [PATCH 1/2] virtio-balloon: export all " Denis V. Lunev
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=56CB7D37.6080704@redhat.com \
--to=eblake@redhat.com \
--cc=den@openvz.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=redkoi@virtuozzo.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.