From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH 1/7] xen: use maximum reservation to limit amount of usable RAM
Date: Wed, 21 Sep 2011 11:09:12 -0400 [thread overview]
Message-ID: <20110921150912.GF541@phenom.oracle.com> (raw)
In-Reply-To: <1316089768-22461-2-git-send-email-david.vrabel@citrix.com>
On Thu, Sep 15, 2011 at 01:29:22PM +0100, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
>
> Use the domain's maximum reservation to limit the amount of extra RAM
> for the memory balloon. This reduces the size of the pages tables and
> the amount of reserved low memory (which defaults to about 1/32 of the
> total RAM).
>
> On a system with 8 GiB of RAM with the domain limited to 1 GiB the
> kernel reports:
>
> Before:
>
> Memory: 627792k/4472000k available
>
> After:
>
> Memory: 549740k/11132224k available
>
> A increase of about 76 MiB (~1.5% of the unused 7 GiB). The reserved
> low memory is also reduced from 253 MiB to 32 MiB. The total
> additional usable RAM is 329 MiB.
>
> For dom0, this requires at patch to Xen ('x86: use 'dom0_mem' to limit
> the number of pages for dom0')[1].
Not going to pick this one up as it already is in 3.1.
>
> [1] http://lists.xensource.com/archives/html/xen-devel/2011-08/msg00567.html
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> arch/x86/xen/setup.c | 19 +++++++++++++++++++
> 1 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index df118a8..c3b8d44 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -184,6 +184,19 @@ static unsigned long __init xen_set_identity(const struct e820entry *list,
> PFN_UP(start_pci), PFN_DOWN(last));
> return identity;
> }
> +
> +static unsigned long __init xen_get_max_pages(void)
> +{
> + unsigned long max_pages = MAX_DOMAIN_PAGES;
> + domid_t domid = DOMID_SELF;
> + int ret;
> +
> + ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
> + if (ret > 0)
> + max_pages = ret;
> + return min(max_pages, MAX_DOMAIN_PAGES);
> +}
> +
> /**
> * machine_specific_memory_setup - Hook for machine specific memory setup.
> **/
> @@ -292,6 +305,12 @@ char * __init xen_memory_setup(void)
>
> sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
>
> + extra_limit = xen_get_max_pages();
> + if (extra_limit >= max_pfn)
> + extra_pages = extra_limit - max_pfn;
> + else
> + extra_pages = 0;
> +
> extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820);
>
> /*
> --
> 1.7.2.5
next prev parent reply other threads:[~2011-09-21 15:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 12:29 xen: memory initialization/balloon fixes (#3) David Vrabel
2011-09-15 12:29 ` [PATCH 1/7] xen: use maximum reservation to limit amount of usable RAM David Vrabel
2011-09-21 15:09 ` Konrad Rzeszutek Wilk [this message]
2011-09-15 12:29 ` [PATCH 2/7] xen: avoid adding non-existant memory if the reservation is unlimited David Vrabel
2011-09-21 15:08 ` Unknown, Konrad Rzeszutek
2011-09-15 12:29 ` [PATCH 3/7] xen/balloon: account for pages released during memory setup David Vrabel
2011-09-21 15:05 ` Konrad Rzeszutek Wilk
2011-09-15 12:29 ` [PATCH 4/7] xen/balloon: simplify test for the end of usable RAM David Vrabel
2011-09-15 12:29 ` [PATCH 5/7] xen: allow balloon driver to use more than one memory region David Vrabel
2011-09-15 12:29 ` [PATCH 6/7] xen: allow extra memory to be in multiple regions David Vrabel
2011-09-15 12:29 ` [PATCH 7/7] xen: release all pages within 1-1 p2m mappings David Vrabel
2011-09-20 16:57 ` xen: memory initialization/balloon fixes (#3) Dan Magenheimer
2011-09-21 22:29 ` Dan Magenheimer
2011-09-22 12:32 ` David Vrabel
2011-09-22 17:06 ` Dan Magenheimer
2011-09-22 22:34 ` Dan Magenheimer
2011-09-22 22:51 ` Jeremy Fitzhardinge
2011-09-22 23:46 ` Dan Magenheimer
2011-09-23 10:45 ` David Vrabel
2011-09-23 13:28 ` Konrad Rzeszutek Wilk
2011-09-23 19:04 ` Dan Magenheimer
2011-09-21 17:11 ` Konrad Rzeszutek Wilk
2011-09-22 13:08 ` David Vrabel
2011-09-24 2:08 ` Konrad Rzeszutek Wilk
2011-09-26 14:20 ` Konrad Rzeszutek Wilk
2011-09-27 14:09 ` David Vrabel
2011-09-27 23:10 ` Konrad Rzeszutek Wilk
2011-09-28 10:45 ` David Vrabel
2011-09-28 13:25 ` Konrad Rzeszutek Wilk
2011-09-28 13:47 ` Konrad Rzeszutek Wilk
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=20110921150912.GF541@phenom.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.