summaryrefslogtreecommitdiffstats
path: root/mm/mlock.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-10-17 17:04:47 +0300
committerGleb Natapov <gleb@redhat.com>2013-10-17 17:41:49 +0300
commit13acfd5715144518232d8e29acf7c76ef1b089d8 (patch)
tree093c4311a737210bbdd3d1919f8193cb5f017241 /mm/mlock.c
parentd570142674890fe10b3d7d86aa105e3dfce1ddfa (diff)
parent34ec4de42be5006abdd8d0c08b306ffaa64d0d5d (diff)
downloadlinux-13acfd5715144518232d8e29acf7c76ef1b089d8.tar.bz2
Powerpc KVM work is based on a commit after rc4.
Merging master into next to satisfy the dependencies. Conflicts: arch/arm/kvm/reset.c
Diffstat (limited to 'mm/mlock.c')
-rw-r--r--mm/mlock.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/mlock.c b/mm/mlock.c
index d63802663242..d480cd6fc475 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -379,10 +379,14 @@ static unsigned long __munlock_pagevec_fill(struct pagevec *pvec,
/*
* Initialize pte walk starting at the already pinned page where we
- * are sure that there is a pte.
+ * are sure that there is a pte, as it was pinned under the same
+ * mmap_sem write op.
*/
pte = get_locked_pte(vma->vm_mm, start, &ptl);
- end = min(end, pmd_addr_end(start, end));
+ /* Make sure we do not cross the page table boundary */
+ end = pgd_addr_end(start, end);
+ end = pud_addr_end(start, end);
+ end = pmd_addr_end(start, end);
/* The page next to the pinned page is the first we will try to get */
start += PAGE_SIZE;
@@ -736,6 +740,7 @@ static int do_mlockall(int flags)
/* Ignore errors */
mlock_fixup(vma, &prev, vma->vm_start, vma->vm_end, newflags);
+ cond_resched();
}
out:
return 0;