OSDN Git Service

mm/oom_kill: remove unneeded is_memcg_oom check
[uclinux-h8/linux.git] / mm / mmap.c
index f61a154..bd3416e 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1616,8 +1616,6 @@ unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len,
                /*
                 * VM_NORESERVE is used because the reservations will be
                 * taken when vm_ops->mmap() is called
-                * A dummy user value is used because we are not locking
-                * memory so no accounting is necessary
                 */
                file = hugetlb_file_setup(HUGETLB_ANON_FILE, len,
                                VM_NORESERVE,
@@ -2557,7 +2555,7 @@ static int __init cmdline_parse_stack_guard_gap(char *p)
        if (!*endptr)
                stack_guard_gap = val << PAGE_SHIFT;
 
-       return 0;
+       return 1;
 }
 __setup("stack_guard_gap=", cmdline_parse_stack_guard_gap);
 
@@ -3448,6 +3446,7 @@ static struct vm_area_struct *__install_special_mapping(
        vma->vm_end = addr + len;
 
        vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND | VM_SOFTDIRTY;
+       vma->vm_flags &= VM_LOCKED_CLEAR_MASK;
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
 
        vma->vm_ops = ops;