All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Piotr Rybicki <piotr.rybicki@innervision.pl>
To: andrey@xdel.ru
Cc: libvir-list@redhat.com, qemu-devel@nongnu.org, v.tolstov@selfip.ru
Subject: Re: [Qemu-devel] incorrect memory size inside vm
Date: Thu, 18 Jun 2015 17:05:34 +0200	[thread overview]
Message-ID: <5582DE3E.5050504@innervision.pl> (raw)
In-Reply-To: <CACaajQueh8_WTC43Odqk+0sDSW5JWoAtnMoZQnnV4f2Rgdvr5Q@mail.gmail.com>

W dniu 2015-06-18 o 00:57, Vasiliy Tolstov pisze:
> 2015-06-18 1:52 GMT+03:00 Andrey Korolyov <andrey@xdel.ru>:
>> 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

  reply	other threads:[~2015-06-18 15:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 13:35 [Qemu-devel] incorrect memory size inside vm Vasiliy Tolstov
2015-06-17 14:09 ` Andrey Korolyov
2015-06-17 15:33   ` Vasiliy Tolstov
2015-06-17 15:38     ` Andrey Korolyov
2015-06-17 16:26       ` Vasiliy Tolstov
2015-06-17 21:21         ` Vasiliy Tolstov
2015-06-17 22:40           ` Andrey Korolyov
2015-06-17 22:44             ` Vasiliy Tolstov
2015-06-17 22:52               ` Andrey Korolyov
2015-06-17 22:57                 ` Vasiliy Tolstov
2015-06-18 15:05                   ` Piotr Rybicki [this message]
2015-06-18 21:23                     ` Andrey Korolyov
2015-06-19 11:14                       ` Piotr Rybicki
2015-06-19 12:01                         ` Andrey Korolyov
2015-06-19 12:02                           ` Vasiliy Tolstov
2015-06-22 13:30                           ` Piotr Rybicki
2015-06-22 15:58                             ` Andrey Korolyov
  -- strict thread matches above, loose matches on Subject: below --
2015-06-23 12:32 Piotr Rybicki
2015-06-23 18:59 ` Andrey Korolyov
2015-06-23 22:10   ` Piotr Rybicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5582DE3E.5050504@innervision.pl \
    --to=piotr.rybicki@innervision.pl \
    --cc=andrey@xdel.ru \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=v.tolstov@selfip.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.