From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49315 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1kD9-00060N-Np for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:20:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1kCr-0003HG-Lx for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:19:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1kCr-0003H9-FR for qemu-devel@nongnu.org; Fri, 01 Oct 2010 14:19:41 -0400 From: Luiz Capitulino Date: Fri, 1 Oct 2010 15:19:07 -0300 Message-Id: <1285957167-1228-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1285957167-1228-1-git-send-email-lcapitulino@redhat.com> References: <1285957167-1228-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 03/23] disable guest-provided stats on "info balloon" command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: qemu-devel@nongnu.org, Eduardo Habkost From: Eduardo Habkost The addition of memory stats reporting to the virtio balloon causes the 'info balloon' command to become asynchronous. This is a regression because in some cases it can hang the user monitor. This is an alternative to Adam Litke's patch. Adam's patch disabled the corresponding (guest-visible) virtio feature bit, causing issues for migration. Original discussion is available at: http://marc.info/?l=qemu-devel&m=128448124328314&w=2 Signed-off-by: Eduardo Habkost Acked-by: Adam Litke --- hw/virtio-balloon.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index 1e74674..8adddea 100644 --- a/hw/virtio-balloon.c +++ b/hw/virtio-balloon.c @@ -29,6 +29,10 @@ #include #endif +/* Disable guest-provided stats by now (https://bugzilla.redhat.com/show_bug.cgi?id=623903) */ +#define ENABLE_GUEST_STATS 0 + + typedef struct VirtIOBalloon { VirtIODevice vdev; @@ -83,12 +87,14 @@ static QObject *get_stats_qobject(VirtIOBalloon *dev) VIRTIO_BALLOON_PFN_SHIFT); stat_put(dict, "actual", actual); +#if ENABLE_GUEST_STATS stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]); stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]); stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]); stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]); stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]); stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]); +#endif return QOBJECT(dict); } @@ -214,7 +220,7 @@ static void virtio_balloon_to_target(void *opaque, ram_addr_t target, } dev->stats_callback = cb; dev->stats_opaque_callback_data = cb_data; - if (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ)) { + if (ENABLE_GUEST_STATS && (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ))) { virtqueue_push(dev->svq, &dev->stats_vq_elem, dev->stats_vq_offset); virtio_notify(&dev->vdev, dev->svq); } else { -- 1.7.3.1.50.g1e633