All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv1] xen/balloon: disable memory hotplug in PV guests
@ 2015-03-09 14:10 David Vrabel
  2015-03-09 15:09 ` Boris Ostrovsky
  2015-03-10 11:40 ` David Vrabel
  0 siblings, 2 replies; 26+ messages in thread
From: David Vrabel @ 2015-03-09 14:10 UTC (permalink / raw)
  To: xen-devel; +Cc: Boris Ostrovsky, Daniel Kiper, David Vrabel

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@citrix.com>
---
Cc: Daniel Kiper <daniel.kiper@oracle.com>
---
 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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-03-19 14:21 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 14:10 [PATCHv1] xen/balloon: disable memory hotplug in PV guests David Vrabel
2015-03-09 15:09 ` Boris Ostrovsky
2015-03-09 15:13   ` David Vrabel
2015-03-09 15:25     ` Boris Ostrovsky
2015-03-09 15:31       ` David Vrabel
2015-03-09 15:40         ` Konrad Rzeszutek Wilk
2015-03-09 15:50         ` Boris Ostrovsky
2015-03-09 20:45         ` Daniel Kiper
2015-03-09 20:22       ` Daniel Kiper
2015-03-10 11:40 ` David Vrabel
2015-03-10 13:35   ` Boris Ostrovsky
2015-03-11 14:42     ` David Vrabel
2015-03-11 15:40       ` Boris Ostrovsky
2015-03-16  5:35         ` Juergen Gross
2015-03-16 10:03           ` Daniel Kiper
2015-03-16 10:31             ` Juergen Gross
2015-03-17 12:40               ` Daniel Kiper
2015-03-17 13:00                 ` Juergen Gross
2015-03-18 10:36               ` David Vrabel
2015-03-18 13:57                 ` Juergen Gross
2015-03-18 13:59                   ` David Vrabel
2015-03-18 15:14                     ` Daniel Kiper
2015-03-19  9:55                       ` Juergen Gross
2015-03-19 11:34                         ` Daniel Kiper
2015-03-19 13:38                           ` Juergen Gross
2015-03-19 14:21                             ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.