We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab7a5af commit 0b57d6bCopy full SHA for 0b57d6b
mm/mmap.c
@@ -2988,14 +2988,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
2988
*/
2989
int may_expand_vm(struct mm_struct *mm, unsigned long npages)
2990
{
2991
- unsigned long cur = mm->total_vm; /* pages */
2992
- unsigned long lim;
2993
-
2994
- lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
2995
2996
- if (cur + npages > lim)
2997
- return 0;
2998
- return 1;
+ return mm->total_vm + npages <= rlimit(RLIMIT_AS) >> PAGE_SHIFT;
2999
}
3000
3001
static int special_mapping_fault(struct vm_area_struct *vma,
0 commit comments