Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11326
b: refs/heads/master
c: e040f21
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Oct 30, 2005
1 parent 117860c commit db7413e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09ad4bbc3a5c93316d7f4ffc0c310d9cbb28c2f0
refs/heads/master: e040f218bb49a6965a5b77edce05fe47a62dda39
14 changes: 8 additions & 6 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,25 +410,27 @@ static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
{
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);
if (!dst_pte)
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;
Expand Down

0 comments on commit db7413e

Please sign in to comment.