From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/arm: p2m: Don't create new table when the mapping is removed Date: Wed, 18 Dec 2013 19:29:42 +0000 Message-ID: <52B1F7A6.7010803@linaro.org> References: <1387387873-3269-1-git-send-email-julien.grall@linaro.org> 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 1VtMoV-0006xl-Ix for xen-devel@lists.xenproject.org; Wed, 18 Dec 2013 19:29:47 +0000 Received: by mail-we0-f181.google.com with SMTP id x55so92493wes.40 for ; Wed, 18 Dec 2013 11:29:45 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: ian.campbell@citrix.com, patches@linaro.org, tim@xen.org, george.dunlap@citrix.com, stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 12/18/2013 07:28 PM, Stefano Stabellini wrote: > On Wed, 18 Dec 2013, Julien Grall wrote: >> When Xen is removing/relinquishing mapping, it will create second/third tables >> if they don't exist. >> >> Non-existent table means the address range was never mapped, so Xen can safely >> skip them. >> >> Signed-off-by: Julien Grall >> >> --- >> Release: This is an improvement for Xen 4.4. It will save time during >> relinquish phase and avoid dummy allocation. >> The downside is the patch is modifying p2m loop which is used everywhere. >> --- >> xen/arch/arm/p2m.c | 22 ++++++++++++++++++++-- >> 1 file changed, 20 insertions(+), 2 deletions(-) >> >> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c >> index d24a6fc..9ef8819 100644 >> --- a/xen/arch/arm/p2m.c >> +++ b/xen/arch/arm/p2m.c >> @@ -246,10 +246,12 @@ static int create_p2m_entries(struct domain *d, >> cur_first_offset = ~0, >> cur_second_offset = ~0; >> unsigned long count = 0; >> + bool_t populate = (op == INSERT || op == ALLOCATE); > > why don't you just check for op == REMOVE? Because you also need to check op == RELINQUISH (added by my patch series on foreign mapping). -- Julien Grall