From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Make ballooning work with maxmem > mem
Date: Wed, 8 Nov 2006 14:24:45 -0200 [thread overview]
Message-ID: <20061108162445.GA24503@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
Trying to start a guest with maxmem > mem and then balloon up to a value
greater than mem is currently failing.
This patch fixes it.
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
[-- Attachment #2: xen-balloon.patch --]
[-- Type: text/plain, Size: 1459 bytes --]
# HG changeset patch
# User gcosta@redhat.com
# Date 1163006677 18000
# Node ID 8347687597a4da4ed323e58e640da89b25bb2c49
# Parent 20204db0891b0b7c10959822e3283656c3600500
[LINUX] Extend physical mapping to maxmem instead of mem
As currently physical mapping only reaches the initial reservation,
we're unable to balloon up to more than mem (even when maxmem > mem)
in any situation.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
diff -r 20204db0891b -r 8347687597a4 linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c Thu Nov 02 18:52:04 2006 +0000
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c Wed Nov 08 12:24:37 2006 -0500
@@ -583,6 +583,7 @@ void __init setup_memory_region(void)
* the boot process we know we have plenty slack space.
*/
struct e820entry map[E820MAX];
+ unsigned long arg = DOMID_SELF;
memmap.nr_entries = E820MAX;
set_xen_guest_handle(memmap.buffer, map);
@@ -591,7 +592,11 @@ void __init setup_memory_region(void)
if ( rc == -ENOSYS ) {
memmap.nr_entries = 1;
map[0].addr = 0ULL;
- map[0].size = xen_start_info->nr_pages << PAGE_SHIFT;
+ rc = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &arg);
+ if ( rc < 0 )
+ map[0].size = xen_start_info->nr_pages << PAGE_SHIFT;
+ else
+ map[0].size = rc << PAGE_SHIFT;
/* 8MB slack (to balance backend allocations). */
map[0].size += 8 << 20;
map[0].type = E820_RAM;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2006-11-08 16:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061108162445.GA24503@redhat.com \
--to=gcosta@redhat.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.