diff mbox series

[RFCv1,5/5] hv_balloon:: try to merge "System RAM" resources

Message ID 20200731091838.7490-6-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series mm/memory_hotplug: selective merging of memory resources | expand

Commit Message

David Hildenbrand July 31, 2020, 9:18 a.m. UTC
Let's reuse the new mechanism to merge "System RAM" resources below the
root. We are the only one hotplugging "System RAM" and DIMMs don't apply,
so this is safe to use.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
 drivers/hv/hv_balloon.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series


diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 32e3bc0aa665a..0745f7cc1727b 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -745,6 +745,9 @@  static void hv_mem_hot_add(unsigned long start, unsigned long size,
 			has->covered_end_pfn -=  processed_pfn;
 			spin_unlock_irqrestore(&dm_device.ha_lock, flags);
+		} else {
+			/* Try to reduce the number of "System RAM" resources. */
+			merge_child_mem_resources(&iomem_resource, "System RAM");