From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5bOA-0006Z7-L7 for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:06:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5bO0-0006Uu-7P for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:05:58 -0400 Received: from mail.iv.net.pl ([195.191.233.10]:49752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5bNz-0006Jv-Di for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:05:48 -0400 Message-ID: <5582DE3E.5050504@innervision.pl> Date: Thu, 18 Jun 2015 17:05:34 +0200 From: Piotr Rybicki MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] incorrect memory size inside vm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrey@xdel.ru Cc: libvir-list@redhat.com, qemu-devel@nongnu.org, v.tolstov@selfip.ru W dniu 2015-06-18 o 00:57, Vasiliy Tolstov pisze: > 2015-06-18 1:52 GMT+03:00 Andrey Korolyov : >> Whoosh... technically it is possible but it would be an incompatible >> fork for the upstreams for both SeaBIOS and Qemu, because the generic >> way of plugging DIMMs in is available down to at least generic 2.6.32. >> Except may be Centos where broken kabi would bring great consequences, >> it may be better to just provide a backport repository with newer >> kernels, but it doesn`t sound very optimistic. For the history >> records, the initial hotplug support proposal provided by Vasilis >> Liaskovitis a couple of years ago worked in an exact way you are >> suggesting to, but its resurrection would mean emulator and rom code >> alteration, as I said above. > > > Ok, i'm try to build latest libvirt and check all oses for memory > hotplug support =). > Hi guys. I'm actually investigating mem waste issue at my lab. I'm using libvirt + qemu on gentoo. # libvirtd -v 2015-06-18 14:50:56.619+0000: 11720: info : libvirt version: 1.2.16 # qemu-x86_64 -version qemu-x86_64 version 2.3.0, Copyright (c) 2003-2008 Fabrice Bellard # uname -a Linux vms06 3.18.14-gentoo #1 SMP Wed Jun 17 14:55:27 CEST 2015 x86_64 AMD Opteron(tm) Processor 6380 AuthenticAMD GNU/Linux When not using dimm (static or hotplugged) - only 'main' memory, waste is huge, especially if one define big limit. my test with only 'plain' memory: define domain.xml with different mem setting, and see mem sizes (virsh domstats DOMAIN --balloon from host and 'free' command from guest) libvirt max: 2GB, curr: 2GB system total: 2001 balloon.current=2097152 balloon.maximum=2097152 libvirt max: 4GB, curr: 4GB system total: 3953 balloon.current=4194304 balloon.maximum=4194304 libvirt max: 4GB, curr: 2GB system total: 1905 balloon.current=2097152 balloon.maximum=4194304 libvirt max: 8GB, curr: 8GB system total: 7985 balloon.current=8388608 balloon.maximum=8388608 libvirt max: 8GB, curr: 4GB system total: 3889 balloon.current=4194304 balloon.maximum=8388608 libvirt max: 8GB, curr: 2GB system total: 1841 balloon.current=2097152 balloon.maximum=8388608 libvirt max: 16GB, curr: 16GB system total: 16049 balloon.current=16777216 balloon.maximum=16777216 libvirt max: 16GB, curr: 8GB system total: 7857 balloon.current=8388608 balloon.maximum=16777216 libvirt max: 16GB, curr: 4GB system total: 3761 balloon.current=4194304 balloon.maximum=16777216 libvirt max: 16GB, curr: 2GB system total: 1713 balloon.current=2097152 balloon.maximum=16777216 As You can see, when one set 16GB max mem and define current mem to 2GB, guest only see 1713 MB. When You set 2GB max mem and leave 2GB mem, guest see 2001. So there are 288 MB wasted. Later, i tried to define 15 static 1GB dimms and 1GB 'main' memory, and later on decreased guest memory via balloon to 1GB, and there was no waste in guest. But, when i checked RES size of qemu process on host, It was about 5,5GB! In contrast, when using only 'main' memory, results were as expected (res mem for qemu was amount ram for guest + qemu itself). Do You see similar results at Your side? Best regards Piotr Rybicki