git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git]
/
mm
/
memory.c
diff --git
a/mm/memory.c
b/mm/memory.c
index
607098d
..
61e66f0
100644
(file)
--- a/
mm/memory.c
+++ b/
mm/memory.c
@@
-1359,7
+1359,7
@@
split_fallthrough:
*/
mark_page_accessed(page);
}
*/
mark_page_accessed(page);
}
- if (
flags & FOLL_MLOCK
) {
+ if (
(flags & FOLL_MLOCK) && (vma->vm_flags & VM_LOCKED)
) {
/*
* The preliminary mapping check is mainly to avoid the
* pointless overhead of lock_page on the ZERO_PAGE
/*
* The preliminary mapping check is mainly to avoid the
* pointless overhead of lock_page on the ZERO_PAGE
@@
-1412,9
+1412,8
@@
no_page_table:
static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
{
static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
{
- return (vma->vm_flags & VM_GROWSDOWN) &&
- (vma->vm_start == addr) &&
- !vma_stack_continue(vma->vm_prev, addr);
+ return stack_guard_page_start(vma, addr) ||
+ stack_guard_page_end(vma, addr+PAGE_SIZE);
}
/**
}
/**
@@
-1551,13
+1550,6
@@
int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
continue;
}
continue;
}
- /*
- * If we don't actually want the page itself,
- * and it's the stack guard page, just skip it.
- */
- if (!pages && stack_guard_page(vma, start))
- goto next_page;
-
do {
struct page *page;
unsigned int foll_flags = gup_flags;
do {
struct page *page;
unsigned int foll_flags = gup_flags;
@@
-1574,6
+1566,11
@@
int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
int ret;
unsigned int fault_flags = 0;
int ret;
unsigned int fault_flags = 0;
+ /* For mlock, just skip the stack guard page. */
+ if (foll_flags & FOLL_MLOCK) {
+ if (stack_guard_page(vma, start))
+ goto next_page;
+ }
if (foll_flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
if (nonblocking)
if (foll_flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
if (nonblocking)