diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-10-08 13:27:11 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-10-08 13:27:11 +0200 |
commit | bfabb59433fc18ff78d2818e10e212d0f85d56ae (patch) | |
tree | dd7cbead179c09c62627a84c16c802d99095ba6e /mm/mlock.c | |
parent | pinctrl: sirf: add USB1/UART1 pinmux usb/uart share (diff) | |
parent | Linux 3.12-rc4 (diff) | |
download | linux-dev-bfabb59433fc18ff78d2818e10e212d0f85d56ae.tar.xz linux-dev-bfabb59433fc18ff78d2818e10e212d0f85d56ae.zip |
Merge tag 'v3.12-rc4' into devel
Linux 3.12-rc4
Diffstat (limited to 'mm/mlock.c')
-rw-r--r-- | mm/mlock.c | 9 |
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; |