Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbbG0LB7 (ORCPT ); Mon, 27 Jul 2015 07:01:59 -0400 Received: from smtp.citrix.com ([66.165.176.89]:53896 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbbG0LB5 (ORCPT ); Mon, 27 Jul 2015 07:01:57 -0400 X-IronPort-AV: E=Sophos;i="5.15,553,1432598400"; d="scan'208";a="284651419" Message-ID: <55B60F6E.3040901@citrix.com> Date: Mon, 27 Jul 2015 12:01:02 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: David Vrabel , CC: , Boris Ostrovsky , "Daniel Kiper" , Subject: Re: [Xen-devel] [PATCHv2 10/10] xen/balloon: pre-allocate p2m entries for ballooned pages 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> In-Reply-To: <55B5FA39.8000401@citrix.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1164 Lines: 34 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. For instance xen_p2m_addr, used within with the xen_alloc_p2m_entry (old name alloc_p2m) is never set for auto-xlate guests. Therefore the value is 0. Same for p2m_identity and p2m_missing & co. Regards, -- Julien Grall -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/