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" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3/3] xen: use maximum reservation to limit dom0 memory
Date: Tue, 16 Aug 2011 10:54:51 -0400	[thread overview]
Message-ID: <20110816145451.GA31376@dumpdata.com> (raw)
In-Reply-To: <4E4A817F.2040406@citrix.com>

On Tue, Aug 16, 2011 at 03:41:03PM +0100, David Vrabel wrote:
> On 16/08/11 14:53, Konrad Rzeszutek Wilk wrote:
> > 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.
> 
> This patch with the Xen patch does, yes.
> 
> > 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.
> 
> Does this problem need to be fixed in stable?  It has a simple
> workaround (the 'mem' kernel command line option) and requires an
> updated Xen.

I would like it be ported to 3.0.3 so folks who are using it
can stop using the work-around.

> 
> I do think that patches #1 and #2 are useful because they allow 32-bit
> guests to have more low memory, rather than making all balloon memory
> high memory.

Sure, but they are a different subset of the problem.

> 
> I could rearrange the order. Make #3 first so it can also be applied to
> 3.0.n and 3.1 and then #1 and #2 could be queued for 3.2.

OK. I was thinking to cherry-pick this specific patch for 3.1 anyhow.

> 
> >> 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.
> 
> Ok.
> 
> >> --- 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
> 
> It is...
> 
> >         max_pages = min(ret, max_pages); ?
> > 
> >>  	}
> >>  
> >>  	return min(max_pages, MAX_DOMAIN_PAGES);
> 
> ... here.

Duh!

> 
> David

  reply	other threads:[~2011-08-16 14:54 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
2011-08-16 14:41     ` David Vrabel
2011-08-16 14:54       ` Konrad Rzeszutek Wilk [this message]
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=20110816145451.GA31376@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.