]> xenbits.xensource.com Git - people/royger/linux.git/commitdiff
(no commit message) wip.balloon2
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 30 Mar 2020 15:54:11 +0000 (17:54 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Mon, 30 Mar 2020 15:57:13 +0000 (17:57 +0200)
drivers/xen/balloon.c

index 0c142bcab79d61d50e67a97862aecabe7c0542a2..8f3becb2c01e64504ea83b5a6a3f69e3d2c24b0c 100644 (file)
@@ -631,6 +631,12 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages)
  out_undo:
        mutex_unlock(&balloon_mutex);
        free_xenballooned_pages(pgno, pages);
+       /*
+        * NB: free_xenballooned_pages will only subtract pgno pages, but since
+        * target_unpopulated is incremented with nr_pages at the start we need
+        * to remove the remaining ones also, or accounting will be screwed.
+        */
+       balloon_stats.target_unpopulated -= nr_pages - pgno;
        return ret;
 }
 EXPORT_SYMBOL(alloc_xenballooned_pages);