Let's reuse the new mechanism to merge system ram resources below the
root. We are the only one hotplugging system ram (e.g., DIMMs don't apply),
so this is safe to be used.

Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Michal Hocko <mho...@suse.com>
Cc: Boris Ostrovsky <boris.ostrov...@oracle.com>
Cc: Juergen Gross <jgr...@suse.com>
Cc: Stefano Stabellini <sstabell...@kernel.org>
Cc: Roger Pau Monné <roger....@citrix.com>
Cc: Julien Grall <jul...@xen.org>
Cc: Pankaj Gupta <pankaj.gupta.li...@gmail.com>
Cc: Baoquan He <b...@redhat.com>
Cc: Wei Yang <richardw.y...@linux.intel.com>
Signed-off-by: David Hildenbrand <da...@redhat.com>
---
 drivers/xen/balloon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 37ffccda8bb87..5ec73f752b8a7 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -338,6 +338,10 @@ static enum bp_state reserve_additional_memory(void)
        if (rc) {
                pr_warn("Cannot add additional memory (%i)\n", rc);
                goto err;
+       } else {
+               resource = NULL;
+               /* Try to reduce the number of system ram resources. */
+               merge_system_ram_resources(&iomem_resource);
        }
 
        balloon_stats.total_pages += balloon_hotplug;
-- 
2.26.2

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to