summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 07e1987979d9..76399cfd8927 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3195,6 +3195,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
return 0;
}
+bool is_vma_temporary_stack(struct vm_area_struct *vma);
/*
* We enter with non-exclusive mmap_sem (to exclude vma changes,
* but allow concurrent faults), and pte mapped but not yet locked.
@@ -3227,7 +3228,12 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* Allocate our own private page. */
if (unlikely(anon_vma_prepare(vma)))
goto oom;
- page = alloc_zeroed_user_highpage_movable(vma, address);
+ if (vma->vm_flags & VM_LOCKED || flags & FAULT_FLAG_NO_CMA ||
+ is_vma_temporary_stack(vma)) {
+ page = alloc_zeroed_user_highpage(GFP_HIGHUSER, vma, address);
+ } else {
+ page = alloc_zeroed_user_highpage_movable(vma, address);
+ }
if (!page)
goto oom;
/*