From patchwork Thu Jan 28 06:51:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 8146811 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 499089FE6C for ; Thu, 28 Jan 2016 06:52:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF704202FE for ; Thu, 28 Jan 2016 06:52:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0754C202DD for ; Thu, 28 Jan 2016 06:52:19 +0000 (UTC) Received: from localhost ([::1]:54256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOgRG-00081y-FZ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Jan 2016 01:52:18 -0500 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 Received: from kvm.sw.ru. ([10.28.8.145]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u0REj6Mr011236; Wed, 27 Jan 2016 17:45:38 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Date: Thu, 28 Jan 2016 09:51:12 +0300 Message-Id: <1453963872-13549-4-git-send-email-vsementsov@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1453963872-13549-1-git-send-email-vsementsov@virtuozzo.com> References: <1453963872-13549-1-git-send-email-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: Vladimir Sementsov-Ogievskiy , Xiao Guangrong , "Michael S. Tsirkin" , Markus Armbruster , Stefan Hajnoczi , Igor Mammedov , "Denis V. Lunev" Subject: [Qemu-devel] [PATCH 3/3] balloon: don't use NVDIMM for ballooning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;