From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjAB-0001ed-1O for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:23:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRjA6-0007nr-2O for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:23:14 -0500 Received: from mx2.parallels.com ([199.115.105.18]:41958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjA5-0007nW-Sb for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:23:09 -0500 Message-ID: <56B4CC60.7050507@virtuozzo.com> Date: Fri, 5 Feb 2016 19:22:56 +0300 From: Vladimir Sementsov-Ogievskiy MIME-Version: 1.0 References: <1454660341-45244-1-git-send-email-vsementsov@virtuozzo.com> <1454660341-45244-6-git-send-email-vsementsov@virtuozzo.com> <20160205135854.0d0e6fae@nial.brq.redhat.com> <56B4AD36.4030903@virtuozzo.com> <20160205155535.3b971dcc@nial.brq.redhat.com> In-Reply-To: <20160205155535.3b971dcc@nial.brq.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] balloon: Use only 'pc-dimm' type dimm for ballooning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: guangrong.xiao@linux.intel.com, mst@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, den@openvz.org, lcapitulino@redhat.com On 05.02.2016 17:55, Igor Mammedov wrote: > On Fri, 5 Feb 2016 17:09:58 +0300 > Vladimir Sementsov-Ogievskiy wrote: > >> On 05.02.2016 15:58, Igor Mammedov wrote: >>> On Fri, 5 Feb 2016 11:19:01 +0300 >>> Vladimir Sementsov-Ogievskiy wrote: >>> >>>> For now there are only two dimm's: pc-dimm and nvdimm. This patch is >>>> actually needed to disable ballooning on nvdimm. But, to avoid future >>>> bugs, instead of disallowing nvdimm, we allow only pc-dimm. So, if >>>> someone adds new dimm which should be balloon-able, then this ability >>>> should be explicitly specified here. >>>> >>>> Why ballooning for nvdimm should be disabled for now: >>>> >>>> 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 >>>> --- >>>> hw/virtio/virtio-balloon.c | 6 +++++- >>>> 1 file changed, 5 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c >>>> index b9c1964..0415e07 100644 >>>> --- a/hw/virtio/virtio-balloon.c >>>> +++ b/hw/virtio/virtio-balloon.c >>>> @@ -18,6 +18,7 @@ >>>> #include "qemu-common.h" >>>> #include "hw/virtio/virtio.h" >>>> #include "hw/i386/pc.h" >>>> +#include "hw/mem/nvdimm.h" >>> Is this include still needed? >> Yes, for TYPE_PC_DIMM > then should it be pc-dimm.h oh, yes, I'm wrong. > >>> >>>> #include "cpu.h" >>>> #include "sysemu/balloon.h" >>>> #include "hw/virtio/virtio-balloon.h" >>>> @@ -302,7 +303,10 @@ static ram_addr_t get_current_ram_size(void) >>>> pc_dimm_build_list(qdev_get_machine(), &list); >>>> for (item = list; item; item = g_slist_next(item)) { >>>> PCDIMMDevice *dimm = item->data; >>>> - size += object_property_get_int(OBJECT(dimm), PC_DIMM_SIZE_PROP, NULL); >>>> + if (!strcmp(object_get_typename(OBJECT(dimm)), TYPE_PC_DIMM)) { >>>> + size += object_property_get_int(OBJECT(dimm), PC_DIMM_SIZE_PROP, >>>> + NULL); >>>> + } >>>> } >>>> g_slist_free(list); >>>> >> -- Best regards, Vladimir