summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-08-31 15:01:16 -0700
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-11-19 22:15:59 -0800
commit9be4d4575906af9698de660e477f949a076c87e1 (patch)
tree9a0857539b14c600ac6802ded4d129f23f5bcecf /drivers
parente04195644eea7c6c14007922257704ec67156cd1 (diff)
downloadop-kernel-dev-9be4d4575906af9698de660e477f949a076c87e1.zip
op-kernel-dev-9be4d4575906af9698de660e477f949a076c87e1.tar.gz
xen: add extra pages to balloon
Add extra pages in the pseudo-physical address space to the balloon so we can extend into them later. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/balloon.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 500290b..df26ee9 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -119,7 +119,7 @@ static void scrub_page(struct page *page)
}
/* balloon_append: add the given page to the balloon. */
-static void balloon_append(struct page *page)
+static void __balloon_append(struct page *page)
{
/* Lowmem is re-populated first, so highmem pages go at list tail. */
if (PageHighMem(page)) {
@@ -130,7 +130,11 @@ static void balloon_append(struct page *page)
list_add(&page->lru, &ballooned_pages);
balloon_stats.balloon_low++;
}
+}
+static void balloon_append(struct page *page)
+{
+ __balloon_append(page);
totalram_pages--;
}
@@ -416,10 +420,13 @@ static int __init balloon_init(void)
register_balloon(&balloon_sysdev);
/* Initialise the balloon with excess memory space. */
- for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
+ for (pfn = PFN_UP(xen_extra_mem_start);
+ pfn < PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size);
+ pfn++) {
page = pfn_to_page(pfn);
- if (!PageReserved(page))
- balloon_append(page);
+ /* totalram_pages doesn't include the boot-time
+ balloon extension, so don't subtract from it. */
+ __balloon_append(page);
}
target_watch.callback = watch_target;
OpenPOWER on IntegriCloud