Skip to contentSkip to conversation

x86/xen: add reschedule point when mapping foreign GFNs

PATCH Superseded David Vrabel 2 participants 2 messages Oct 27, 2015 – Oct 28, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

---
 arch/x86/xen/mmu.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/xen/mmu.c +1 -0
index 9c479fe..734fa84 100644
@@ -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
#1 lore raw
Quoted 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.

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

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