Skip to contentSkip to conversation

x86/xen: add reschedule point when mapping foreign GFNs

PATCH In review David Vrabel 2 participants 2 messages Oct 28, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
v2:
- Move cond_resched() to outer loop.

---
 arch/x86/xen/mmu.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/xen/mmu.c +1 -0
index 9c479fe..ac161db 100644
@@ -2888,6 +2888,7 @@ static int do_remap_gfn(struct vm_area_struct *vma,
 		addr += range;
 		if (err_ptr)
 			err_ptr += batch;
+		cond_resched();
 	}
 out:
 
Signature · 1 line
2.1.4
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 16 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.

---
v2:
- Move cond_resched() to outer loop.

---
  arch/x86/xen/mmu.c | 1 +
  1 file changed, 1 insertion(+)
arch/x86/xen/mmu.c +0 -0
index 9c479fe..ac161db 100644

arch/x86/xen/mmu.c static int do_remap_gfn(struct vm_area_struct *vma, · line 2894

Quoted 7 lines
arch/x86/xen/mmu.c +1 -0
@@ -2888,6 +2888,7 @@ static int do_remap_gfn(struct vm_area_struct *vma,
  		addr += range;
  		if (err_ptr)
  			err_ptr += batch;
+		cond_resched();
  	}
  out: