diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -612,7 +612,7 @@ again: remove_next = 1 + (end > next->vm_end); | |||
612 | * If the vma has a ->close operation then the driver probably needs to release | 612 | * If the vma has a ->close operation then the driver probably needs to release |
613 | * per-vma resources, so we don't attempt to merge those. | 613 | * per-vma resources, so we don't attempt to merge those. |
614 | */ | 614 | */ |
615 | #define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) | 615 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) |
616 | 616 | ||
617 | static inline int is_mergeable_vma(struct vm_area_struct *vma, | 617 | static inline int is_mergeable_vma(struct vm_area_struct *vma, |
618 | struct file *file, unsigned long vm_flags) | 618 | struct file *file, unsigned long vm_flags) |
@@ -845,14 +845,6 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags, | |||
845 | const unsigned long stack_flags | 845 | const unsigned long stack_flags |
846 | = VM_STACK_FLAGS & (VM_GROWSUP|VM_GROWSDOWN); | 846 | = VM_STACK_FLAGS & (VM_GROWSUP|VM_GROWSDOWN); |
847 | 847 | ||
848 | #ifdef CONFIG_HUGETLB | ||
849 | if (flags & VM_HUGETLB) { | ||
850 | if (!(flags & VM_DONTCOPY)) | ||
851 | mm->shared_vm += pages; | ||
852 | return; | ||
853 | } | ||
854 | #endif /* CONFIG_HUGETLB */ | ||
855 | |||
856 | if (file) { | 848 | if (file) { |
857 | mm->shared_vm += pages; | 849 | mm->shared_vm += pages; |
858 | if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC) | 850 | if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC) |
@@ -1048,12 +1040,11 @@ munmap_back: | |||
1048 | * specific mapper. the address has already been validated, but | 1040 | * specific mapper. the address has already been validated, but |
1049 | * not unmapped, but the maps are removed from the list. | 1041 | * not unmapped, but the maps are removed from the list. |
1050 | */ | 1042 | */ |
1051 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 1043 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); |
1052 | if (!vma) { | 1044 | if (!vma) { |
1053 | error = -ENOMEM; | 1045 | error = -ENOMEM; |
1054 | goto unacct_error; | 1046 | goto unacct_error; |
1055 | } | 1047 | } |
1056 | memset(vma, 0, sizeof(*vma)); | ||
1057 | 1048 | ||
1058 | vma->vm_mm = mm; | 1049 | vma->vm_mm = mm; |
1059 | vma->vm_start = addr; | 1050 | vma->vm_start = addr; |
@@ -1904,12 +1895,11 @@ unsigned long do_brk(unsigned long addr, unsigned long len) | |||
1904 | /* | 1895 | /* |
1905 | * create a vma struct for an anonymous mapping | 1896 | * create a vma struct for an anonymous mapping |
1906 | */ | 1897 | */ |
1907 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 1898 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); |
1908 | if (!vma) { | 1899 | if (!vma) { |
1909 | vm_unacct_memory(len >> PAGE_SHIFT); | 1900 | vm_unacct_memory(len >> PAGE_SHIFT); |
1910 | return -ENOMEM; | 1901 | return -ENOMEM; |
1911 | } | 1902 | } |
1912 | memset(vma, 0, sizeof(*vma)); | ||
1913 | 1903 | ||
1914 | vma->vm_mm = mm; | 1904 | vma->vm_mm = mm; |
1915 | vma->vm_start = addr; | 1905 | vma->vm_start = addr; |