Skip to content

Commit

Permalink
xen: add extra pages to balloon
Browse files Browse the repository at this point in the history
Add extra pages in the pseudo-physical address space to the balloon
so we can extend into them later.

Signed-off-by: Jeremy Fitzhardinge <[email protected]>
  • Loading branch information
Jeremy Fitzhardinge committed Nov 20, 2010
1 parent e041956 commit 9be4d45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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--;
}

Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions include/xen/page.h
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
#ifndef _XEN_PAGE_H
#define _XEN_PAGE_H

#include <asm/xen/page.h>

extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size;

#endif /* _XEN_PAGE_H */

0 comments on commit 9be4d45

Please sign in to comment.