x86/xen: add reschedule point when mapping foreign GFNs
Subsystems (2)
PATCH 1/1 x86/xen: add reschedule point when mapping foreign GFNs
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 <[email protected]>
--- arch/x86/xen/mmu.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/xen/mmu.c +1 -0
@@ -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;
Signature · 1 line
2.1.4
Boris Ostrovsky
reviewerQuoted 13 lines · 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 <[email protected]>--- arch/x86/xen/mmu.c | 1 + 1 file changed, 1 insertion(+)arch/x86/xen/mmu.c +0
-0
arch/x86/xen/mmu.c static int do_remap_gfn(struct vm_area_struct *vma, · line 2888
Quoted 7 lines
arch/x86/xen/mmu.c +1
-0@@ -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