xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xensource.com
Cc: David Vrabel <david.vrabel@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 3/3] xen: use maximum reservation to limit dom0 memory
Date: Tue, 16 Aug 2011 11:00:38 +0100	[thread overview]
Message-ID: <1313488838-28809-4-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1313488838-28809-1-git-send-email-david.vrabel@citrix.com>

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.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
Note this requires a patched Xen that sets max_pages when creating dom0.
---
 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;
 	}
 
 	return min(max_pages, MAX_DOMAIN_PAGES);
-- 
1.7.4.1

  parent reply	other threads:[~2011-08-16 10:00 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 ` David Vrabel [this message]
2011-08-16 13:53   ` [PATCH 3/3] xen: use maximum reservation to limit dom0 memory Konrad Rzeszutek Wilk
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=1313488838-28809-4-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).