All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 3/3] xen: use maximum reservation to limit dom0 memory
Date: Tue, 16 Aug 2011 09:53:52 -0400	[thread overview]
Message-ID: <20110816135352.GD30261@dumpdata.com> (raw)
In-Reply-To: <1313488838-28809-4-git-send-email-david.vrabel@citrix.com>

On Tue, Aug 16, 2011 at 11:00:38AM +0100, David Vrabel wrote:
> Use the maximum reservation hypercall to set limit the amount of
> usable dom0 memory.  This reduces the size of pages tables etc. if
> dom0 is to use less memory than the maximum available.

Ok, so it sounds like this patch by itself can fix the "more page tables
than we need" issue.

If so, I would prefer that you stick the tiny piece of code that
calls the xen_get_max_pages() from the setup in this patch. This way
we can backport this particular patch to stable tree without including
the other patchsets you have posted. And it is a nicely contained
one-patch-fixes-the-problem.

> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> Note this requires a patched Xen that sets max_pages when creating dom0.

Please mention in the description the c/s and the name of the patch.

> ---
>  arch/x86/xen/setup.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 3421c9e..584e7dc 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -197,7 +197,12 @@ static unsigned long __init xen_get_max_pages(void)
>  	unsigned long max_pages = MAX_DOMAIN_PAGES; /* Limited by memory map. */
>  
>  	if (xen_initial_domain()) {
> -		/* FIXME: ask hypervisor for max pages. */
> +		domid_t domid = DOMID_SELF;
> +		int ret;
> +
> +		ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
> +		if (ret > 0)
> +			max_pages = ret;
Don't you want to clamp it? Say MAX_DOMAIN_PAGES is set to 1GB, and you
set it to 2GB here - that will blow the P2M out. Perhaps
        max_pages = min(ret, max_pages); ?

>  	}
>  
>  	return min(max_pages, MAX_DOMAIN_PAGES);
> -- 
> 1.7.4.1

  reply	other threads:[~2011-08-16 13:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16 10:00 [RFC] limit dom0 memory using Xen's dom0_mem command line option David Vrabel
2011-08-16 10:00 ` [PATCH 1/3] xen: allow balloon driver to use more than one memory region David Vrabel
2011-08-16 13:38   ` Konrad Rzeszutek Wilk
2011-08-16 14:21     ` David Vrabel
2011-08-16 14:48       ` Konrad Rzeszutek Wilk
2011-08-16 15:03         ` David Vrabel
2011-08-16 10:00 ` [PATCH 2/3] xen: allow extra memory to be two regions David Vrabel
2011-08-16 13:48   ` Konrad Rzeszutek Wilk
2011-08-16 14:33     ` David Vrabel
2011-08-16 14:48       ` Konrad Rzeszutek Wilk
2011-08-16 15:03         ` David Vrabel
2011-08-16 15:36           ` Konrad Rzeszutek Wilk
2011-08-22 13:55             ` Konrad Rzeszutek Wilk
2011-08-22 14:01               ` David Vrabel
2011-08-16 10:00 ` [PATCH 3/3] xen: use maximum reservation to limit dom0 memory David Vrabel
2011-08-16 13:53   ` Konrad Rzeszutek Wilk [this message]
2011-08-16 14:41     ` David Vrabel
2011-08-16 14:54       ` Konrad Rzeszutek Wilk
2011-08-16 14:50     ` Konrad Rzeszutek Wilk
2011-08-16 13:33 ` [RFC] limit dom0 memory using Xen's dom0_mem command line option 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=20110816135352.GD30261@dumpdata.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.