From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v5 08/10] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page Date: Tue, 17 Dec 2013 14:57:02 +0000 Message-ID: <52B0663E.9080508@linaro.org> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> <1387215452-10951-9-git-send-email-julien.grall@linaro.org> <1387272410.21086.60.camel@kazak.uk.xensource.com> <52B0624F.50200@linaro.org> <1387291341.27441.67.camel@kazak.uk.xensource.com> <52B0637F.1030308@linaro.org> <1387291969.27441.68.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vsw62-0005Ms-J1 for xen-devel@lists.xenproject.org; Tue, 17 Dec 2013 14:58:06 +0000 Received: by mail-ee0-f51.google.com with SMTP id b15so2945038eek.24 for ; Tue, 17 Dec 2013 06:57:05 -0800 (PST) In-Reply-To: <1387291969.27441.68.camel@kazak.uk.xensource.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, Jan Beulich , stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On 12/17/2013 02:52 PM, Ian Campbell wrote: > On Tue, 2013-12-17 at 14:45 +0000, Julien Grall wrote: >> On 12/17/2013 02:42 PM, Ian Campbell wrote: >>> On Tue, 2013-12-17 at 14:40 +0000, Julien Grall wrote: >>>> On 12/17/2013 09:26 AM, Ian Campbell wrote: >>>>> On Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote: >>>>>> + if ( op == RELINQUISH && count == LPAE_ENTRIES && >>>>>> + hypercall_preempt_check() ) >>>>>> + { >>>>> >>>>> If hypercall_preempt_check returns false the first time it is called >>>>> then you won't ever try again. I think you want >>>>> (count+1 % LPAE_ENTRIES) == 0 >>>>> (the +1 avoids preempting without having done any work yet) >>>> >>>> I don't think we need +1 because count is increment each round just >>>> before the check. >>> >>> Ah yes, if the increment has already happened then good. >>> >>>> Is a solution as Jan made for x86 would be more appropriate? >>> >>> It's about equivalent I think? I'd hope the compiler would take a mod >>> 2^N and turn it into a mask, but I suppose you never know... >> >> I was talking about adding a greater increment when it's a foreign mapping. > > Like I said in the other subthread: > > BTW, Jan's approach in his x86 fix was to preempt every 2MB of present > or 32MB of non-present mappings, which makes sense because you skip > through the non-present ones more quickly. It'd be nice but lets not > hold up the series if it isn't trivial to achieve. Sorry I didn't yet read this mail. I will try to implement the same behavior for the next version. -- Julien Grall