From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCHv1] x86/xen: add reschedule point when mapping foreign GFNs Date: Wed, 28 Oct 2015 09:10:56 -0400 Message-ID: <5630C960.908@oracle.com> References: <1445946602-27588-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 1ZrQVJ-0008Sl-FR for xen-devel@lists.xenproject.org; Wed, 28 Oct 2015 13:11:01 +0000 In-Reply-To: <1445946602-27588-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 List-Id: xen-devel@lists.xenproject.org On 10/27/2015 07:50 AM, David Vrabel wrote: > Mapping a large range of foreign GFNs can take a long time, add a > reschedule point after each batch of 16 GFNs. > > Signed-off-by: David Vrabel > --- > arch/x86/xen/mmu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c > index 9c479fe..734fa84 100644 > --- a/arch/x86/xen/mmu.c > +++ b/arch/x86/xen/mmu.c > @@ -2882,6 +2882,7 @@ static int do_remap_gfn(struct vm_area_struct *vma, > mapped += done; > batch_left -= done; > index += done; > + cond_resched(); > } while (batch_left); > > nr -= batch; Shouldn't this be done in the outer (i.e. 'while (nr)') loop? The inner loop always processes 16 pages. -boris