diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2014-09-03 14:07:41 -0700 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2014-11-05 16:02:49 -0800 |
commit | c1dced9d6dd1ecf754373b29e7c74410f6ebd01e (patch) | |
tree | be318d615cf9c4d7ef003b788ad4b2bd1f52f6f0 /mm | |
parent | ed56e0d628213375f32a08d3eb06f22b1aa4f91a (diff) |
mm: avoid allocating CMA memory for stack
allocation of CMA memory for user stack would cause
permanent migration failures and result in CMA
allocation failures.
Bug 1550455
Change-Id: I75ac13416dbcf1810c89641cefdd0d56726cc36a
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/495322
(cherry picked from commit 3c59fb443605d5975b9d8e250c4ca52ae1650fe5)
Reviewed-on: http://git-master/r/592897
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 8 |
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; /* |