From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOgR0-0007r8-8p for qemu-devel@nongnu.org; Thu, 28 Jan 2016 01:52:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOgQz-0003vu-AX for qemu-devel@nongnu.org; Thu, 28 Jan 2016 01:52:02 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:13971 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOgQy-0003v9-U6 for qemu-devel@nongnu.org; Thu, 28 Jan 2016 01:52:01 -0500 From: Vladimir Sementsov-Ogievskiy Date: Thu, 28 Jan 2016 09:51:12 +0300 Message-Id: <1453963872-13549-4-git-send-email-vsementsov@virtuozzo.com> In-Reply-To: <1453963872-13549-1-git-send-email-vsementsov@virtuozzo.com> References: <1453963872-13549-1-git-send-email-vsementsov@virtuozzo.com> Subject: [Qemu-devel] [PATCH 3/3] balloon: don't use NVDIMM for ballooning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Vladimir Sementsov-Ogievskiy , Xiao Guangrong , "Michael S. Tsirkin" , Markus Armbruster , Stefan Hajnoczi , Igor Mammedov , "Denis V. Lunev" NVDIMM for now is planned to use as a backing store for DAX filesystem in the guest and thus this memory is excluded from guest memory management and LRUs. In this case libvirt running QEMU along with configured balloon almost immediately inflates balloon and effectively kill the guest as qemu counts nvdimm as part of the ram. Counting dimm devices as part of the ram for ballooning was started from commit 463756d03: virtio-balloon: Fix balloon not working correctly when hotplug memory Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Xiao Guangrong CC: "Michael S. Tsirkin" CC: Igor Mammedov CC: Eric Blake CC: Markus Armbruster --- hw/virtio/virtio-balloon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 6a4c4d2..749be25 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -26,6 +26,7 @@ #include "qapi/visitor.h" #include "qapi-event.h" #include "trace.h" +#include "hw/mem/nvdimm.h" #if defined(__linux__) #include @@ -308,7 +309,9 @@ static ram_addr_t get_current_ram_size(void) if (value) { switch (value->type) { case MEMORY_DEVICE_INFO_KIND_DIMM: - size += value->u.dimm->size; + if (strcmp(value->u.dimm->type, TYPE_NVDIMM)) { + size += value->u.dimm->size; + } break; default: break; -- 1.8.3.1