{
pte_t *src_pte, *dst_pte;
unsigned long vm_flags = vma->vm_flags;
- int progress;
+ int progress = 0;
again:
dst_pte = pte_alloc_map(dst_mm, dst_pmd, addr);
return -ENOMEM;
src_pte = pte_offset_map_nested(src_pmd, addr);
- progress = 0;
spin_lock(&src_mm->page_table_lock);
do {
/*
* We are holding two locks at this point - either of them
* could generate latencies in another task on another CPU.
*/
- if (progress >= 32 && (need_resched() ||
- need_lockbreak(&src_mm->page_table_lock) ||
- need_lockbreak(&dst_mm->page_table_lock)))
- break;
+ if (progress >= 32) {
+ progress = 0;
+ if (need_resched() ||
+ need_lockbreak(&src_mm->page_table_lock) ||
+ need_lockbreak(&dst_mm->page_table_lock))
+ break;
+ }
if (pte_none(*src_pte)) {
progress++;
continue;