From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Rushikesh Jadhav <2rushikeshj@gmail.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Whats effect of EXTRA_MEM_RATIO
Date: Mon, 3 Jun 2013 08:10:18 -0400 [thread overview]
Message-ID: <20130603121018.GB6893@phenom.dumpdata.com> (raw)
In-Reply-To: <CAO9XypWO7SdL_xWV4NLD+WpPnUBKQY8NyrFin7z9gULVft9LTQ@mail.gmail.com>
On Sun, Jun 02, 2013 at 02:57:11AM +0530, Rushikesh Jadhav wrote:
> Hi guys,
>
> Im fairly new to the Xen Development & trying to understand ballooning.
OK.
>
> While compiling a DomU kernel I'm trying to understand the e820 memory map
> w.r.t Xen,
>
> I have modified arch/x86/xen/setup.c EXTRA_MEM_RATIO to 1 and can see
> that the guest can not balloon up more than 2GB. Below is the memory map of
> DomU with max mem as 16GB.
>
> for EXTRA_MEM_RATIO = 1
>
> BIOS-provided physical RAM map:
> Xen: 0000000000000000 - 00000000000a0000 (usable)
> Xen: 00000000000a0000 - 0000000000100000 (reserved)
> Xen: 0000000000100000 - 0000000080000000 (usable)
> Xen: 0000000080000000 - 0000000400000000 (unusable)
> NX (Execute Disable) protection: active
> DMI not present or invalid.
> e820 update range: 0000000000000000 - 0000000000010000 (usable) ==>
> (reserved)
> e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
> No AGP bridge found
> last_pfn = 0x80000 max_arch_pfn = 0x400000000
> initial memory mapped : 0 - 0436c000
> Base memory trampoline at [ffff88000009b000] 9b000 size 20480
> init_memory_mapping: 0000000000000000-0000000080000000
> 0000000000 - 0080000000 page 4k
> kernel direct mapping tables up to 80000000 @ bfd000-1000000
> xen: setting RW the range fd6000 - 1000000
>
>
> for EXTRA_MEM_RATIO = 10 the map is like below and can balloon up to 16GB.
>
Right, that is the default value.
> BIOS-provided physical RAM map:
> Xen: 0000000000000000 - 00000000000a0000 (usable)
> Xen: 00000000000a0000 - 0000000000100000 (reserved)
> Xen: 0000000000100000 - 0000000400000000 (usable)
> NX (Execute Disable) protection: active
> DMI not present or invalid.
> e820 update range: 0000000000000000 - 0000000000010000 (usable) ==>
> (reserved)
> e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
> No AGP bridge found
> last_pfn = 0x400000 max_arch_pfn = 0x400000000
> last_pfn = 0x100000 max_arch_pfn = 0x400000000
> initial memory mapped : 0 - 0436c000
> Base memory trampoline at [ffff88000009b000] 9b000 size 20480
> init_memory_mapping: 0000000000000000-0000000100000000
> 0000000000 - 0100000000 page 4k
> kernel direct mapping tables up to 100000000 @ 7fb000-1000000
> xen: setting RW the range fd6000 - 1000000
> init_memory_mapping: 0000000100000000-0000000400000000
> 0100000000 - 0400000000 page 4k
> kernel direct mapping tables up to 400000000 @ 601ef000-62200000
> xen: setting RW the range 619fb000 - 62200000
>
>
>
> Can someone please help me understand its behavior and importance ?
Here is the explanation from the code:
384 /*
385 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
386 * factor the base size. On non-highmem systems, the base
387 * size is the full initial memory allocation; on highmem it
388 * is limited to the max size of lowmem, so that it doesn't
389 * get completely filled.
390 *
391 * In principle there could be a problem in lowmem systems if
392 * the initial memory is also very large with respect to
393 * lowmem, but we won't try to deal with that here.
394 */
395 extra_pages = min(EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)),
396 extra_pages);
I am unclear on what you are exactly want to learn? The hypercalls or how
the balloning happens? IF so I would recommend you work backwards - look
at the balloon driver itself, how it decreases/increases the memory, and what
data structures it uses to figure out how much memory it can use. Then you
can go back to the setup.c to get an idea on how the E820 is being created.
>
> Thanks.
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-06-03 12:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-01 21:27 Whats effect of EXTRA_MEM_RATIO Rushikesh Jadhav
2013-06-03 12:10 ` Konrad Rzeszutek Wilk [this message]
2013-06-03 16:28 ` Rushikesh Jadhav
2013-06-03 17:50 ` Konrad Rzeszutek Wilk
2013-07-09 20:06 ` Rushikesh Jadhav
2013-07-16 15:42 ` Konrad Rzeszutek Wilk
2013-07-16 16:17 ` Rushikesh Jadhav
2013-07-16 16:28 ` Konrad Rzeszutek Wilk
2013-07-16 17:26 ` Rushikesh Jadhav
2013-07-16 19:49 ` Rushikesh Jadhav
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=20130603121018.GB6893@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=2rushikeshj@gmail.com \
--cc=xen-devel@lists.xen.org \
/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.