xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv1] x86/xen: add reschedule point when mapping foreign GFNs
@ 2015-10-27 11:50 David Vrabel
  2015-10-28 13:10 ` Boris Ostrovsky
  0 siblings, 1 reply; 2+ messages in thread
From: David Vrabel @ 2015-10-27 11:50 UTC (permalink / raw)
  To: xen-devel; +Cc: Boris Ostrovsky, David Vrabel

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 <david.vrabel@citrix.com>
---
 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;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv1] x86/xen: add reschedule point when mapping foreign GFNs
  2015-10-27 11:50 [PATCHv1] x86/xen: add reschedule point when mapping foreign GFNs David Vrabel
@ 2015-10-28 13:10 ` Boris Ostrovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Ostrovsky @ 2015-10-28 13:10 UTC (permalink / raw)
  To: David Vrabel, xen-devel

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 <david.vrabel@citrix.com>
> ---
>   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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-28 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 11:50 [PATCHv1] x86/xen: add reschedule point when mapping foreign GFNs David Vrabel
2015-10-28 13:10 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).