Hello, I would like to ask you some clarification about the memory management in the XEN hypervisor, because I had some bad experiences using my PC when the dom0 is running. I have 4GB of RAM on my system, and they are absolutely not faulty, so, when I boot with a "traditional" kernel, I can see them all if I perform a "cat /proc/meminfo" or "free", as regard the total amount of available memory. What happens here is that when I boot the same kernel, but using the xen.gz hypervisor, the total amount of RAM is less than 4 GB. The main reason why I am curious is that this value randomly changes. In practise, when booting the dom0, one time I can see 1,5GB of TOTAL RAM, once 1GB, once 3GB, and so on. For instance, this is what I see now: $ free total used free shared buffers cached Mem: 3225484 1669384 1556100 $ cat /proc/meminfo |grep MemTotal MemTotal: 3225484 kB Furthermore, the amount of free RAM is making me worried, because, sometime if I perform some heavy load processing (e.g. kernel compilations) my system freezes, especially if Mozilla Firefox is open. Talking with a friend of mine, I deduced that the dom0 takes (reserves) a certain amount of RAM. Is it that correct? How does it work? Is there a way to rule this behaviour? Is it possible to tell the dom0 how much RAM to take? I''m running Gentoo Linux x86_64 kernel 3.1.3. Thanks, -- Flavio
>________________________________________ >From: xen-users-bounces@lists.xensource.com [xen-users-bounces@lists.xensource.com] On Behalf Of Flavio [fbcyborg@gmail.com] >Sent: 07 December 2011 12:16 >To: xen-users@lists.xensource.com >Subject: [Xen-users] Strange memory issue > >Hello, > >I would like to ask you some clarification about the memory management in the >XEN hypervisor, because I had some bad experiences using my PC when the dom0 >is running. > >I have 4GB of RAM on my system, and they are absolutely not faulty, so, when I >boot with a "traditional" kernel, I can see them all if I perform a >"cat /proc/meminfo" >or "free", as regard the total amount of available memory. > >What happens here is that when I boot the same kernel, but using the xen.gz >hypervisor, the total amount of RAM is less than 4 GB. The main reason why I am >curious is that this value randomly changes. In practise, when booting >the dom0, >one time I can see 1,5GB of TOTAL RAM, once 1GB, once 3GB, and so on. > >For instance, this is what I see now: >$ free > total used free shared buffers cached >Mem: 3225484 1669384 1556100 > >$ cat /proc/meminfo |grep MemTotal >MemTotal: 3225484 kB > >Furthermore, the amount of free RAM is making me worried, because, sometime >if I perform some heavy load processing (e.g. kernel compilations) my system >freezes, especially if Mozilla Firefox is open. > >Talking with a friend of mine, I deduced that the dom0 takes >(reserves) a certain amount >of RAM. Is it that correct? How does it work? >Is there a way to rule this behaviour? Is it possible to tell the dom0 >how much RAM to >take? > >I''m running Gentoo Linux x86_64 kernel 3.1.3. > >Thanks, > >-- >FlavioThis one might help eventually - Dom0 memory balooning. http://wiki.xen.org/xenwiki/XenBestPractices Regards Matej
On 7 December 2011 12:34, Zary Matej <matej.zary@cvtisr.sk> wrote:> > This one might help eventually - Dom0 memory balooning. > > http://wiki.xen.org/xenwiki/XenBestPracticesThanks a lot. This is now much more clear to me. In this moment (I booted with no dom0_mem option) if I perform xl list, I can see this: Name ID Mem VCPUs State Time(s) Domain-0 0 2321 4 r----- 724.5 I didn''t understand to what memory "Mem" refers to. Consider the memory values I''ve reported before. So putting the dom0_mem option into the kernel grub line, what should I expect to be changed among "Mem" or "MemTotal"? I cannot reboot in this very moment. Reading the wiki, I suppose that putting dom0_mem=1024M, will give me this: Name ID Mem VCPUs State Time(s) Domain-0 0 1024 4 r----- 724.5 Right? But I have some question, since I''m no longer using xend. I use the new xl toolstack, and the wiki says "This can be done by editing /etc/xen/xend-config.sxp...". So, I would like to know if there is something to change (e.g.) in xl.conf file. Thanks -- Flavio
On 7 December 2011 13:54, Flavio <fbcyborg@gmail.com> wrote:> > Reading the wiki, I suppose that putting dom0_mem=1024M, will give me this: > Name ID Mem VCPUs State Time(s) > Domain-0 0 1024 4 r----- 724.5 > Right?OK, I tried to do as the wiki says but something very BAD happens. The situation is worse than before. I''ve put this line in the grub.conf: kernel /xen.gz dom0_mem=1024M loglvl=all guest_loglvl=all And actually I can see this: # xl list Name ID Mem VCPUs State Time(s) Domain-0 0 1024 4 r----- 76.7 But these results are very absurd: # free total used free Mem: 890100 862140 27960 # cat /proc/meminfo MemTotal: 890100 kB MemFree: 28052 kB Only 28MB free??? O_O There is something that I did not understand or something not working here. -- Flavio
On 7 December 2011 18:23, Flavio <fbcyborg@gmail.com> wrote:> > # cat /proc/meminfo > MemTotal: 890100 kB > MemFree: 28052 kB > > Only 28MB free??? O_OSomething even worse happened here. I''ve put dom0_mem=512M and this is what I can see: # free total used free Mem: 366832 335876 30956 # cat /proc/meminfo MemTotal: 366832 kB MemFree: 31052 kB 366MB of total RAM? only 31MB free? I try to put dom0_mem=4096M and see what it happens. -- Flavio
On 7 December 2011 18:40, Flavio <fbcyborg@gmail.com> wrote:> I try to put dom0_mem=4096M and see what it happens.No, it''s not correct. It reboots saying that there is no memory for dom0. At this point I have no more ideas. -- Flavio
The memory is all screwed up even on kernel 3.1 and still isn''t fixed! On 7 Dec 2011, at 17:49, "Flavio" <fbcyborg@gmail.com> wrote:> On 7 December 2011 18:40, Flavio <fbcyborg@gmail.com> wrote: >> I try to put dom0_mem=4096M and see what it happens. > No, it''s not correct. It reboots saying that there is no memory > for dom0. > > At this point I have no more ideas. > > -- > Flavio > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >
On 7 December 2011 18:51, Ian Tobin <itobin@tidyhosts.com> wrote:> The memory is all screwed up even on kernel 3.1 and still isn''t fixed!OK, thanks for the info. At least I have a reason for this behaviour. Cheers, Flavio
2011/12/7 Ian Tobin <itobin@tidyhosts.com>:> The memory is all screwed up even on kernel 3.1 and still isn''t fixed!That sucks. I think it depends on the distro, though. I tried on Ubuntu 11.10 and it was a total fail. Starting a 40GB domU took like 10 minutes because of ballooning. Doing something like xl mem-set Domain-0 16384 ended in the OOM killer destroying the system. Whereas on Alpine Linux dom0_mem seemed to work. But I haven''t yet managed to do something as bring up a CentOS5 domU with networking there. But hey... at some point it might be possible to actually run a server on something higher than 4.0.2. :) Flo -- the purpose of libvirt is to provide an abstraction layer hiding all xen features added since 2006 until they were finally understood and copied by the kvm devs.
On 7 December 2011 18:51, Ian Tobin <itobin@tidyhosts.com> wrote:> The memory is all screwed up even on kernel 3.1 and still isn''t fixed!The kernel 3.2.0 is finally out. What about this new version, as regard the problem we are discussing? Cheers, -- Flavio
On 5 January 2012 16:05, Flavio <fbcyborg@gmail.com> wrote:> On 7 December 2011 18:51, Ian Tobin <itobin@tidyhosts.com> wrote: >> The memory is all screwed up even on kernel 3.1 and still isn''t fixed! > The kernel 3.2.0 is finally out. What about this new version, as > regard the problem > we are discussing?Any news? I see this problem is still happening with 3.3.0 kernel. -- Flavio