From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv2 10/10] xen/balloon: pre-allocate p2m entries for ballooned pages Date: Mon, 27 Jul 2015 13:40:04 +0100 Message-ID: <55B626A4.4000903__22075.3321577378$1438000891$gmane$org@citrix.com> References: <1437738468-24110-1-git-send-email-david.vrabel@citrix.com> <1437738468-24110-11-git-send-email-david.vrabel@citrix.com> <55B2C882.8050903@citrix.com> <55B5FA39.8000401@citrix.com> <55B60F6E.3040901@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1ZJhhT-00047W-10 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2015 12:40:11 +0000 In-Reply-To: <55B60F6E.3040901@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: Julien Grall , David Vrabel , xen-devel@lists.xenproject.org Cc: linux-mm@kvack.org, Boris Ostrovsky , Daniel Kiper , linux-kernel@vger.kernel.org List-Id: xen-devel@lists.xenproject.org On 27/07/15 12:01, Julien Grall wrote: > On 27/07/15 10:30, David Vrabel wrote: >> On 25/07/15 00:21, Julien Grall wrote: >>> On 24/07/2015 12:47, David Vrabel wrote: >>>> @@ -550,6 +551,11 @@ int alloc_xenballooned_pages(int nr_pages, struct >>>> page **pages) >>>> page = balloon_retrieve(true); >>>> if (page) { >>>> pages[pgno++] = page; >>>> +#ifdef CONFIG_XEN_HAVE_PVMMU >>>> + ret = xen_alloc_p2m_entry(page_to_pfn(page)); >>> >>> Don't you want to call this function only when the guest is not using >>> auto-translated physmap? >> >> xen_alloc_p2m_entry() is a nop in auto-xlate guests, so no need for an >> additional check here. > > I don't have the impression it's the case or it's not obvious. Oops. You're right. I'll add a if (xen_feature(XENFEAT_auto_translated_physmap)) return true; Check at the top. David