Xuehai Zhang
2005-Jul-07 16:30 UTC
[Xen-users] problem to balloon memory beyond initial allocation
Hi all, I did the following experiment to test booting a domU with less memory than its maximum then growing its memory via balloon driver later. I followed by the suggestions from: http://lists.xensource.com/archives/html/xen-users/2005-04/msg00294.html http://lists.xensource.com/archives/html/xen-devel/2005-04/msg00634.html The xen version I use is 2.0 testing tree wit "Latest ChangeSet: 2005/06/08". Both dom0 and domU kernel version is 2.6.11.11. The memory allocation with only dom0 running looks as following: # xm list Name Id Mem(MB) CPU State Time(s) Console Domain-0 0 379 0 r---- 194.0 # xm info | grep mem memory : 1023 free_memory : 622 The configuration file for the domU (named vm1) looks like: [snip] kernel = "/boot/vmlinuz-2.6.11-xenU" memory = 128 [snip] root = "/dev/sda1 ro" extra = "mem=268435456" #256MB [snip] I pass "mem=268435456" to vm1''s kernel command line, which will set the size of mem_map or maxmem to 256MB. However, "memory=128" will only allocate 128MB memory to vm1 at its creation time. After vm1 is created, I checked its memory allocation status. - from vm1 console: # dmesg | grep mem Kernel command line: ip=128.135.164.83:1.2.3.4:128.135.164.65:255.255.255.192::eth0:off root=/dev/sda1 ro mem=268435456 vmalloc area: d0800000-fbff9000, maxmem 34000000 Memory: 125376k/262144k available (1630k kernel code, 5324k reserved, 440k data, 112k init, 0k highmem) xen_mem: Initialising balloon driver. Freeing unused kernel memory: 112k freed # cat /proc/xen/balloon Current allocation: 131072 kB Requested target: 131072 kB Low-mem balloon: 131072 kB High-mem balloon: 0 kB Xen hard limit: ??? kB The "dmesg" output line "Memory: 125376k/262144k available" confirms 128MB out of 256MB is currently allocated to vm1. The "/proc/xen/balloon" output line "Low-mem balloon: 131072 kB" shows (if I understand correctly) there is 128MB unused memory left which can be added to the existing 128MB allocation. BTW, can anyone explain the meanings of last three entries, Low-mem balloon, High-mem balloon, and Xen hard limit? One question I have here is, what is the real maxmem value (the value we can set with "xm maxmem vm1" command too) for vm1 at this stage? Is it 128MB (according to Xen users'' manual, "Xen associates a memory size limit with each domain. By default, this is the amount of memory the domain is originally started with, preventing the domain from ever growing beyond this size") or 256MB (because we pass "mem=256MB" as kernel command line)? - from dom0 # xm list Name Id Mem(MB) CPU State Time(s) Console Domain-0 0 379 0 r---- 196.5 vm1 12 127 0 -b--- 1.0 9612 # xm info | grep mem memory : 1023 free_memory : 495 Output from dom0 indicates vm1 is allocated 128MB memory. Next I tried to increase vm1''s memory. Because I am not sure if vm1''s maxmem is set to 128MB or 256MB (as discussed above), I ran the "xm maxmem" command first from dom0. # xm maxmem vm1 256 When going back to vm1''s console to check "/proc/xen/balloon", it keeps the same: # cat /proc/xen/balloon Current allocation: 131072 kB Requested target: 131072 kB Low-mem balloon: 131072 kB High-mem balloon: 0 kB Xen hard limit: ??? kB Then in dom0 I tried to increase vm1''s memory to 200MB by running "xm balloon" command: # xm balloon vm1 200 # xm list Name Id Mem(MB) CPU State Time(s) Console Domain-0 0 379 0 r---- 197.4 vm1 12 127 0 -b--- 1.0 9612 # xm info | grep mem memory : 1023 free_memory : 494 Surprisingly, vm1''s memory is still 128MB (not 200MB we want to increase to) and the free memory is still similar as before. When going back to vm1''s console to check "/proc/xen/balloon" again, I found "Xen hard limit" is set with "128MB" value instead of "???" before. It seems to me "Xen hard limit" will forbid vm1''s memory go beyond 128MB. The requested target is also changed, which reflects the new memory value we want to increased to, 200MB. # cat /proc/xen/balloon Current allocation: 131044 kB Requested target: 204800 kB Low-mem balloon: 131100 kB High-mem balloon: 0 kB Xen hard limit: 131044 kB (inc. 28 kB driver headroom) My above experiment is not very successful. I will appreciate if you can point out what I did wrong. Thanks in advance! Xuehai _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users