[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCHv1] xen/balloon: disable memory hotplug in PV guests



Memory hotplug doesn't work with PV guests because:

  a) The p2m cannot be expanded to cover the new sections.

  b) add_memory() builds page tables for the new sections which means
     the new pages must have valid p2m entries (or a BUG occurs).

So, in PV guests, clamp the target to the current (== maximum) number
of pages and do not try to hotplug any memory.

Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx>
---
Cc: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
 drivers/xen/balloon.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 0b52d92..4158196 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -225,6 +225,19 @@ static enum bp_state reserve_additional_memory(long credit)
        u64 hotplug_start_paddr;
        unsigned long balloon_hotplug = credit;
 
+       /*
+        * Memory hotplug doesn't work with PV guests because:
+        *
+        *   a) The p2m cannot be expanded to cover the new sections.
+        *
+        *   b) add_memory() builds page tables for the new sections
+        *      which means they must be fully populated in advance.
+        */
+       if (xen_pv_domain()) {
+               balloon_stats.target_pages = balloon_stats.current_pages;
+               return BP_DONE;
+       }
+
        hotplug_start_paddr = PFN_PHYS(SECTION_ALIGN_UP(max_pfn));
        balloon_hotplug = round_up(balloon_hotplug, PAGES_PER_SECTION);
        nid = memory_add_physaddr_to_nid(hotplug_start_paddr);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.