aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/balloon.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-08-31 18:01:16 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-11-20 01:15:59 -0500
commit9be4d4575906af9698de660e477f949a076c87e1 (patch)
tree9a0857539b14c600ac6802ded4d129f23f5bcecf /drivers/xen/balloon.c
parente04195644eea7c6c14007922257704ec67156cd1 (diff)
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/xen/balloon.c')
-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 500290b150bb..df26ee9caa68 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -119,7 +119,7 @@ static void scrub_page(struct page *page)
119} 119}
120 120
121/* balloon_append: add the given page to the balloon. */ 121/* balloon_append: add the given page to the balloon. */
122static void balloon_append(struct page *page) 122static void __balloon_append(struct page *page)
123{ 123{
124 /* Lowmem is re-populated first, so highmem pages go at list tail. */ 124 /* Lowmem is re-populated first, so highmem pages go at list tail. */
125 if (PageHighMem(page)) { 125 if (PageHighMem(page)) {
@@ -130,7 +130,11 @@ static void balloon_append(struct page *page)
130 list_add(&page->lru, &ballooned_pages); 130 list_add(&page->lru, &ballooned_pages);
131 balloon_stats.balloon_low++; 131 balloon_stats.balloon_low++;
132 } 132 }
133}
133 134
135static void balloon_append(struct page *page)
136{
137 __balloon_append(page);
134 totalram_pages--; 138 totalram_pages--;
135} 139}
136 140
@@ -416,10 +420,13 @@ static int __init balloon_init(void)
416 register_balloon(&balloon_sysdev); 420 register_balloon(&balloon_sysdev);
417 421
418 /* Initialise the balloon with excess memory space. */ 422 /* Initialise the balloon with excess memory space. */
419 for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { 423 for (pfn = PFN_UP(xen_extra_mem_start);
424 pfn < PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size);
425 pfn++) {
420 page = pfn_to_page(pfn); 426 page = pfn_to_page(pfn);
421 if (!PageReserved(page)) 427 /* totalram_pages doesn't include the boot-time
422 balloon_append(page); 428 balloon extension, so don't subtract from it. */
429 __balloon_append(page);
423 } 430 }
424 431
425 target_watch.callback = watch_target; 432 target_watch.callback = watch_target;