From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCHv1] xen/balloon: disable memory hotplug in PV guests Date: Mon, 09 Mar 2015 11:09:44 -0400 Message-ID: <54FDB7B8.7000305@oracle.com> References: <1425910200-17541-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YUzKt-0006XE-Ig for xen-devel@lists.xenproject.org; Mon, 09 Mar 2015 15:11:15 +0000 In-Reply-To: <1425910200-17541-1-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel , xen-devel@lists.xenproject.org Cc: Daniel Kiper List-Id: xen-devel@lists.xenproject.org On 03/09/2015 10:10 AM, David Vrabel wrote: > 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). Is this due to recent p2m rework? -boris > > 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 > --- > Cc: Daniel Kiper > --- > 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);