diff options
| -rw-r--r-- | drivers/xen/balloon.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d31505b6f7a4..6eb62654410a 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
| @@ -136,6 +136,8 @@ static void balloon_append(struct page *page) | |||
| 136 | list_add(&page->lru, &ballooned_pages); | 136 | list_add(&page->lru, &ballooned_pages); |
| 137 | balloon_stats.balloon_low++; | 137 | balloon_stats.balloon_low++; |
| 138 | } | 138 | } |
| 139 | |||
| 140 | totalram_pages--; | ||
| 139 | } | 141 | } |
| 140 | 142 | ||
| 141 | /* balloon_retrieve: rescue a page from the balloon, if it is not empty. */ | 143 | /* balloon_retrieve: rescue a page from the balloon, if it is not empty. */ |
| @@ -156,6 +158,8 @@ static struct page *balloon_retrieve(void) | |||
| 156 | else | 158 | else |
| 157 | balloon_stats.balloon_low--; | 159 | balloon_stats.balloon_low--; |
| 158 | 160 | ||
| 161 | totalram_pages++; | ||
| 162 | |||
| 159 | return page; | 163 | return page; |
| 160 | } | 164 | } |
| 161 | 165 | ||
| @@ -260,7 +264,6 @@ static int increase_reservation(unsigned long nr_pages) | |||
| 260 | } | 264 | } |
| 261 | 265 | ||
| 262 | balloon_stats.current_pages += nr_pages; | 266 | balloon_stats.current_pages += nr_pages; |
| 263 | totalram_pages = balloon_stats.current_pages; | ||
| 264 | 267 | ||
| 265 | out: | 268 | out: |
| 266 | spin_unlock_irqrestore(&balloon_lock, flags); | 269 | spin_unlock_irqrestore(&balloon_lock, flags); |
| @@ -323,7 +326,6 @@ static int decrease_reservation(unsigned long nr_pages) | |||
| 323 | BUG_ON(ret != nr_pages); | 326 | BUG_ON(ret != nr_pages); |
| 324 | 327 | ||
| 325 | balloon_stats.current_pages -= nr_pages; | 328 | balloon_stats.current_pages -= nr_pages; |
| 326 | totalram_pages = balloon_stats.current_pages; | ||
| 327 | 329 | ||
| 328 | spin_unlock_irqrestore(&balloon_lock, flags); | 330 | spin_unlock_irqrestore(&balloon_lock, flags); |
| 329 | 331 | ||
| @@ -422,7 +424,6 @@ static int __init balloon_init(void) | |||
| 422 | pr_info("xen_balloon: Initialising balloon driver.\n"); | 424 | pr_info("xen_balloon: Initialising balloon driver.\n"); |
| 423 | 425 | ||
| 424 | balloon_stats.current_pages = min(xen_start_info->nr_pages, max_pfn); | 426 | balloon_stats.current_pages = min(xen_start_info->nr_pages, max_pfn); |
| 425 | totalram_pages = balloon_stats.current_pages; | ||
| 426 | balloon_stats.target_pages = balloon_stats.current_pages; | 427 | balloon_stats.target_pages = balloon_stats.current_pages; |
| 427 | balloon_stats.balloon_low = 0; | 428 | balloon_stats.balloon_low = 0; |
| 428 | balloon_stats.balloon_high = 0; | 429 | balloon_stats.balloon_high = 0; |
