diff options
author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2012-10-08 19:29:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 03:22:19 -0400 |
commit | 314e51b9851b4f4e8ab302243ff5a6fc6147f379 (patch) | |
tree | f757b89206355fd129830782566768693eed23ce | |
parent | 0103bd16fb90bc741c7a03fd1ea4e8a505abad23 (diff) |
mm: kill vma flag VM_RESERVED and mm->reserved_vm counter
A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
currently it lost original meaning but still has some effects:
| effect | alternative flags
-+------------------------+---------------------------------------------
1| account as reserved_vm | VM_IO
2| skip in core dump | VM_IO, VM_DONTDUMP
3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
4| do not mlock | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
This patch removes reserved_vm counter from mm_struct. Seems like nobody
cares about it, it does not exported into userspace directly, it only
reduces total_vm showed in proc.
Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.
remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.
[akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Carsten Otte <cotte@de.ibm.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Eric Paris <eparis@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
Cc: Matt Helsley <matthltc@us.ibm.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Venkatesh Pallipadi <venki@google.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
70 files changed, 77 insertions, 105 deletions
diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt index fa206cccf89f..323ff5dba1cc 100644 --- a/Documentation/vm/unevictable-lru.txt +++ b/Documentation/vm/unevictable-lru.txt | |||
@@ -371,8 +371,8 @@ mlock_fixup() filters several classes of "special" VMAs: | |||
371 | mlock_fixup() will call make_pages_present() in the hugetlbfs VMA range to | 371 | mlock_fixup() will call make_pages_present() in the hugetlbfs VMA range to |
372 | allocate the huge pages and populate the ptes. | 372 | allocate the huge pages and populate the ptes. |
373 | 373 | ||
374 | 3) VMAs with VM_DONTEXPAND or VM_RESERVED are generally userspace mappings of | 374 | 3) VMAs with VM_DONTEXPAND are generally userspace mappings of kernel pages, |
375 | kernel pages, such as the VDSO page, relay channel pages, etc. These pages | 375 | such as the VDSO page, relay channel pages, etc. These pages |
376 | are inherently unevictable and are not managed on the LRU lists. | 376 | are inherently unevictable and are not managed on the LRU lists. |
377 | mlock_fixup() treats these VMAs the same as hugetlbfs VMAs. It calls | 377 | mlock_fixup() treats these VMAs the same as hugetlbfs VMAs. It calls |
378 | make_pages_present() to populate the ptes. | 378 | make_pages_present() to populate the ptes. |
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c index 53649c7d0068..b51f7b4818cd 100644 --- a/arch/alpha/kernel/pci-sysfs.c +++ b/arch/alpha/kernel/pci-sysfs.c | |||
@@ -26,7 +26,7 @@ static int hose_mmap_page_range(struct pci_controller *hose, | |||
26 | base = sparse ? hose->sparse_io_base : hose->dense_io_base; | 26 | base = sparse ? hose->sparse_io_base : hose->dense_io_base; |
27 | 27 | ||
28 | vma->vm_pgoff += base >> PAGE_SHIFT; | 28 | vma->vm_pgoff += base >> PAGE_SHIFT; |
29 | vma->vm_flags |= (VM_IO | VM_RESERVED); | 29 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
30 | 30 | ||
31 | return io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | 31 | return io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
32 | vma->vm_end - vma->vm_start, | 32 | vma->vm_end - vma->vm_start, |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index f388b4e18a37..ea39eba61ef5 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2307,7 +2307,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t | |||
2307 | */ | 2307 | */ |
2308 | vma->vm_mm = mm; | 2308 | vma->vm_mm = mm; |
2309 | vma->vm_file = get_file(filp); | 2309 | vma->vm_file = get_file(filp); |
2310 | vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED; | 2310 | vma->vm_flags = VM_READ|VM_MAYREAD|VM_DONTEXPAND|VM_DONTDUMP; |
2311 | vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ | 2311 | vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ |
2312 | 2312 | ||
2313 | /* | 2313 | /* |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 0eab454867a2..082e383c1b6f 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -138,7 +138,8 @@ ia64_init_addr_space (void) | |||
138 | vma->vm_mm = current->mm; | 138 | vma->vm_mm = current->mm; |
139 | vma->vm_end = PAGE_SIZE; | 139 | vma->vm_end = PAGE_SIZE; |
140 | vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); | 140 | vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); |
141 | vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED; | 141 | vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | |
142 | VM_DONTEXPAND | VM_DONTDUMP; | ||
142 | down_write(¤t->mm->mmap_sem); | 143 | down_write(¤t->mm->mmap_sem); |
143 | if (insert_vm_struct(current->mm, vma)) { | 144 | if (insert_vm_struct(current->mm, vma)) { |
144 | up_write(¤t->mm->mmap_sem); | 145 | up_write(¤t->mm->mmap_sem); |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 83e929e66f9d..721d4603a235 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -1183,7 +1183,7 @@ static const struct vm_operations_struct kvm_rma_vm_ops = { | |||
1183 | 1183 | ||
1184 | static int kvm_rma_mmap(struct file *file, struct vm_area_struct *vma) | 1184 | static int kvm_rma_mmap(struct file *file, struct vm_area_struct *vma) |
1185 | { | 1185 | { |
1186 | vma->vm_flags |= VM_RESERVED; | 1186 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1187 | vma->vm_ops = &kvm_rma_vm_ops; | 1187 | vma->vm_ops = &kvm_rma_vm_ops; |
1188 | return 0; | 1188 | return 0; |
1189 | } | 1189 | } |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index acc8c838ff72..75b31bcdeadf 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -779,7 +779,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev, | |||
779 | static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, | 779 | static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, |
780 | enum pci_mmap_state mmap_state) | 780 | enum pci_mmap_state mmap_state) |
781 | { | 781 | { |
782 | vma->vm_flags |= (VM_IO | VM_RESERVED); | 782 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
783 | } | 783 | } |
784 | 784 | ||
785 | /* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci | 785 | /* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index b6f0458c3143..b008586dad75 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -380,7 +380,7 @@ int vectors_user_mapping(void) | |||
380 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | 380 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, |
381 | VM_READ | VM_EXEC | | 381 | VM_READ | VM_EXEC | |
382 | VM_MAYREAD | VM_MAYEXEC | | 382 | VM_MAYREAD | VM_MAYEXEC | |
383 | VM_RESERVED, | 383 | VM_DONTEXPAND | VM_DONTDUMP, |
384 | NULL); | 384 | NULL); |
385 | } | 385 | } |
386 | 386 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 5a16824cc2b3..fd28d86fe3d2 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -2451,8 +2451,7 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | |||
2451 | 2451 | ||
2452 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); | 2452 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); |
2453 | 2453 | ||
2454 | BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) == | 2454 | BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP | VM_IO))); |
2455 | (VM_PFNMAP | VM_RESERVED | VM_IO))); | ||
2456 | 2455 | ||
2457 | rmd.mfn = mfn; | 2456 | rmd.mfn = mfn; |
2458 | rmd.prot = prot; | 2457 | rmd.prot = prot; |
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 0c7d340b9ab9..f74e892711dd 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -507,7 +507,7 @@ static int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma) | |||
507 | 507 | ||
508 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 508 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
509 | 509 | ||
510 | /* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */ | 510 | /* Remap-pfn-range will mark the range VM_IO */ |
511 | if (remap_pfn_range(vma, | 511 | if (remap_pfn_range(vma, |
512 | vma->vm_start, | 512 | vma->vm_start, |
513 | __pa(soft->gscr_addr) >> PAGE_SHIFT, | 513 | __pa(soft->gscr_addr) >> PAGE_SHIFT, |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index e5eedfa24c91..0537903c985b 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -322,7 +322,7 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma) | |||
322 | 322 | ||
323 | vma->vm_ops = &mmap_mem_ops; | 323 | vma->vm_ops = &mmap_mem_ops; |
324 | 324 | ||
325 | /* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */ | 325 | /* Remap-pfn-range will mark the range VM_IO */ |
326 | if (remap_pfn_range(vma, | 326 | if (remap_pfn_range(vma, |
327 | vma->vm_start, | 327 | vma->vm_start, |
328 | vma->vm_pgoff, | 328 | vma->vm_pgoff, |
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index 845f97fd1832..e1f60f968fdd 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c | |||
@@ -286,7 +286,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma, | |||
286 | atomic_set(&vdata->refcnt, 1); | 286 | atomic_set(&vdata->refcnt, 1); |
287 | vma->vm_private_data = vdata; | 287 | vma->vm_private_data = vdata; |
288 | 288 | ||
289 | vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP | VM_DONTEXPAND); | 289 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; |
290 | if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED) | 290 | if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED) |
291 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 291 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
292 | vma->vm_ops = &mspec_vm_ops; | 292 | vma->vm_ops = &mspec_vm_ops; |
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 92177d5aedee..24efae464e2c 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
@@ -706,7 +706,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) | |||
706 | goto out_unlock; | 706 | goto out_unlock; |
707 | } | 707 | } |
708 | 708 | ||
709 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND; | 709 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; |
710 | vma->vm_ops = obj->dev->driver->gem_vm_ops; | 710 | vma->vm_ops = obj->dev->driver->gem_vm_ops; |
711 | vma->vm_private_data = map->handle; | 711 | vma->vm_private_data = map->handle; |
712 | vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); | 712 | vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); |
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 23a824e6a22a..db7bd292410b 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
@@ -514,8 +514,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) | |||
514 | 514 | ||
515 | vma->vm_ops = &drm_vm_dma_ops; | 515 | vma->vm_ops = &drm_vm_dma_ops; |
516 | 516 | ||
517 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ | 517 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
518 | vma->vm_flags |= VM_DONTEXPAND; | ||
519 | 518 | ||
520 | drm_vm_open_locked(dev, vma); | 519 | drm_vm_open_locked(dev, vma); |
521 | return 0; | 520 | return 0; |
@@ -643,21 +642,16 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) | |||
643 | case _DRM_SHM: | 642 | case _DRM_SHM: |
644 | vma->vm_ops = &drm_vm_shm_ops; | 643 | vma->vm_ops = &drm_vm_shm_ops; |
645 | vma->vm_private_data = (void *)map; | 644 | vma->vm_private_data = (void *)map; |
646 | /* Don't let this area swap. Change when | ||
647 | DRM_KERNEL advisory is supported. */ | ||
648 | vma->vm_flags |= VM_RESERVED; | ||
649 | break; | 645 | break; |
650 | case _DRM_SCATTER_GATHER: | 646 | case _DRM_SCATTER_GATHER: |
651 | vma->vm_ops = &drm_vm_sg_ops; | 647 | vma->vm_ops = &drm_vm_sg_ops; |
652 | vma->vm_private_data = (void *)map; | 648 | vma->vm_private_data = (void *)map; |
653 | vma->vm_flags |= VM_RESERVED; | ||
654 | vma->vm_page_prot = drm_dma_prot(map->type, vma); | 649 | vma->vm_page_prot = drm_dma_prot(map->type, vma); |
655 | break; | 650 | break; |
656 | default: | 651 | default: |
657 | return -EINVAL; /* This should never happen. */ | 652 | return -EINVAL; /* This should never happen. */ |
658 | } | 653 | } |
659 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ | 654 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
660 | vma->vm_flags |= VM_DONTEXPAND; | ||
661 | 655 | ||
662 | drm_vm_open_locked(dev, vma); | 656 | drm_vm_open_locked(dev, vma); |
663 | return 0; | 657 | return 0; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index fcdbe46914f7..d2545560664f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -500,7 +500,7 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp, | |||
500 | 500 | ||
501 | DRM_DEBUG_KMS("%s\n", __FILE__); | 501 | DRM_DEBUG_KMS("%s\n", __FILE__); |
502 | 502 | ||
503 | vma->vm_flags |= (VM_IO | VM_RESERVED); | 503 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
504 | 504 | ||
505 | update_vm_cache_attr(exynos_gem_obj, vma); | 505 | update_vm_cache_attr(exynos_gem_obj, vma); |
506 | 506 | ||
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 884ba73ac6ce..afded54dbb10 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c | |||
@@ -178,8 +178,7 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
178 | */ | 178 | */ |
179 | vma->vm_ops = &psbfb_vm_ops; | 179 | vma->vm_ops = &psbfb_vm_ops; |
180 | vma->vm_private_data = (void *)psbfb; | 180 | vma->vm_private_data = (void *)psbfb; |
181 | vma->vm_flags |= VM_RESERVED | VM_IO | | 181 | vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; |
182 | VM_MIXEDMAP | VM_DONTEXPAND; | ||
183 | return 0; | 182 | return 0; |
184 | } | 183 | } |
185 | 184 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index a877813571a4..3ba72dbdc4bd 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c | |||
@@ -285,7 +285,7 @@ int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma, | |||
285 | */ | 285 | */ |
286 | 286 | ||
287 | vma->vm_private_data = bo; | 287 | vma->vm_private_data = bo; |
288 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_MIXEDMAP | VM_DONTEXPAND; | 288 | vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; |
289 | return 0; | 289 | return 0; |
290 | out_unref: | 290 | out_unref: |
291 | ttm_bo_unref(&bo); | 291 | ttm_bo_unref(&bo); |
@@ -300,7 +300,7 @@ int ttm_fbdev_mmap(struct vm_area_struct *vma, struct ttm_buffer_object *bo) | |||
300 | 300 | ||
301 | vma->vm_ops = &ttm_bo_vm_ops; | 301 | vma->vm_ops = &ttm_bo_vm_ops; |
302 | vma->vm_private_data = ttm_bo_reference(bo); | 302 | vma->vm_private_data = ttm_bo_reference(bo); |
303 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_MIXEDMAP | VM_DONTEXPAND; | 303 | vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND; |
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | EXPORT_SYMBOL(ttm_fbdev_mmap); | 306 | EXPORT_SYMBOL(ttm_fbdev_mmap); |
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index 67df842fbb33..69a2b16f42a6 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c | |||
@@ -243,7 +243,7 @@ static int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
243 | size = 0; | 243 | size = 0; |
244 | } | 244 | } |
245 | 245 | ||
246 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | 246 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_uverbs.c b/drivers/infiniband/hw/ehca/ehca_uverbs.c index 45ee89b65c23..1a1d5d99fcf9 100644 --- a/drivers/infiniband/hw/ehca/ehca_uverbs.c +++ b/drivers/infiniband/hw/ehca/ehca_uverbs.c | |||
@@ -117,7 +117,7 @@ static int ehca_mmap_fw(struct vm_area_struct *vma, struct h_galpas *galpas, | |||
117 | physical = galpas->user.fw_handle; | 117 | physical = galpas->user.fw_handle; |
118 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 118 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
119 | ehca_gen_dbg("vsize=%llx physical=%llx", vsize, physical); | 119 | ehca_gen_dbg("vsize=%llx physical=%llx", vsize, physical); |
120 | /* VM_IO | VM_RESERVED are set by remap_pfn_range() */ | 120 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
121 | ret = remap_4k_pfn(vma, vma->vm_start, physical >> EHCA_PAGESHIFT, | 121 | ret = remap_4k_pfn(vma, vma->vm_start, physical >> EHCA_PAGESHIFT, |
122 | vma->vm_page_prot); | 122 | vma->vm_page_prot); |
123 | if (unlikely(ret)) { | 123 | if (unlikely(ret)) { |
@@ -139,7 +139,7 @@ static int ehca_mmap_queue(struct vm_area_struct *vma, struct ipz_queue *queue, | |||
139 | u64 start, ofs; | 139 | u64 start, ofs; |
140 | struct page *page; | 140 | struct page *page; |
141 | 141 | ||
142 | vma->vm_flags |= VM_RESERVED; | 142 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
143 | start = vma->vm_start; | 143 | start = vma->vm_start; |
144 | for (ofs = 0; ofs < queue->queue_length; ofs += PAGE_SIZE) { | 144 | for (ofs = 0; ofs < queue->queue_length; ofs += PAGE_SIZE) { |
145 | u64 virt_addr = (u64)ipz_qeit_calc(queue, ofs); | 145 | u64 virt_addr = (u64)ipz_qeit_calc(queue, ofs); |
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index 736d9edbdbe7..3eb7e454849b 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -1225,7 +1225,7 @@ static int mmap_kvaddr(struct vm_area_struct *vma, u64 pgaddr, | |||
1225 | 1225 | ||
1226 | vma->vm_pgoff = (unsigned long) addr >> PAGE_SHIFT; | 1226 | vma->vm_pgoff = (unsigned long) addr >> PAGE_SHIFT; |
1227 | vma->vm_ops = &ipath_file_vm_ops; | 1227 | vma->vm_ops = &ipath_file_vm_ops; |
1228 | vma->vm_flags |= VM_RESERVED | VM_DONTEXPAND; | 1228 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1229 | ret = 1; | 1229 | ret = 1; |
1230 | 1230 | ||
1231 | bail: | 1231 | bail: |
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c index faa44cb08071..959a5c4ff812 100644 --- a/drivers/infiniband/hw/qib/qib_file_ops.c +++ b/drivers/infiniband/hw/qib/qib_file_ops.c | |||
@@ -971,7 +971,7 @@ static int mmap_kvaddr(struct vm_area_struct *vma, u64 pgaddr, | |||
971 | 971 | ||
972 | vma->vm_pgoff = (unsigned long) addr >> PAGE_SHIFT; | 972 | vma->vm_pgoff = (unsigned long) addr >> PAGE_SHIFT; |
973 | vma->vm_ops = &qib_file_vm_ops; | 973 | vma->vm_ops = &qib_file_vm_ops; |
974 | vma->vm_flags |= VM_RESERVED | VM_DONTEXPAND; | 974 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
975 | ret = 1; | 975 | ret = 1; |
976 | 976 | ||
977 | bail: | 977 | bail: |
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 7bc775219f97..e5a76da86081 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c | |||
@@ -1647,7 +1647,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma) | |||
1647 | 1647 | ||
1648 | vma->vm_ops = &meye_vm_ops; | 1648 | vma->vm_ops = &meye_vm_ops; |
1649 | vma->vm_flags &= ~VM_IO; /* not I/O memory */ | 1649 | vma->vm_flags &= ~VM_IO; /* not I/O memory */ |
1650 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | 1650 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1651 | vma->vm_private_data = (void *) (offset / gbufsize); | 1651 | vma->vm_private_data = (void *) (offset / gbufsize); |
1652 | meye_vm_open(vma); | 1652 | meye_vm_open(vma); |
1653 | 1653 | ||
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 66ac21d466af..134016f0e660 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c | |||
@@ -911,7 +911,7 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma) | |||
911 | 911 | ||
912 | q->bufs[i]->baddr = vma->vm_start; | 912 | q->bufs[i]->baddr = vma->vm_start; |
913 | 913 | ||
914 | vma->vm_flags |= VM_RESERVED; | 914 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
915 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 915 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
916 | vma->vm_ops = &omap_vout_vm_ops; | 916 | vma->vm_ops = &omap_vout_vm_ops; |
917 | vma->vm_private_data = (void *) vout; | 917 | vma->vm_private_data = (void *) vout; |
diff --git a/drivers/media/platform/vino.c b/drivers/media/platform/vino.c index 790d96cffeea..70b0bf4b2900 100644 --- a/drivers/media/platform/vino.c +++ b/drivers/media/platform/vino.c | |||
@@ -3950,7 +3950,7 @@ found: | |||
3950 | 3950 | ||
3951 | fb->map_count = 1; | 3951 | fb->map_count = 1; |
3952 | 3952 | ||
3953 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 3953 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3954 | vma->vm_flags &= ~VM_IO; | 3954 | vma->vm_flags &= ~VM_IO; |
3955 | vma->vm_private_data = fb; | 3955 | vma->vm_private_data = fb; |
3956 | vma->vm_file = file; | 3956 | vma->vm_file = file; |
diff --git a/drivers/media/usb/sn9c102/sn9c102_core.c b/drivers/media/usb/sn9c102/sn9c102_core.c index 19ea780b16ff..5bfc8e2f018f 100644 --- a/drivers/media/usb/sn9c102/sn9c102_core.c +++ b/drivers/media/usb/sn9c102/sn9c102_core.c | |||
@@ -2126,8 +2126,7 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) | |||
2126 | return -EINVAL; | 2126 | return -EINVAL; |
2127 | } | 2127 | } |
2128 | 2128 | ||
2129 | vma->vm_flags |= VM_IO; | 2129 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
2130 | vma->vm_flags |= VM_RESERVED; | ||
2131 | 2130 | ||
2132 | pos = cam->frame[i].bufmem; | 2131 | pos = cam->frame[i].bufmem; |
2133 | while (size > 0) { /* size is page-aligned */ | 2132 | while (size > 0) { /* size is page-aligned */ |
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index f67018ed3795..5c36a57e6590 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c | |||
@@ -1108,8 +1108,7 @@ static int usbvision_mmap(struct file *file, struct vm_area_struct *vma) | |||
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | /* VM_IO is eventually going to replace PageReserved altogether */ | 1110 | /* VM_IO is eventually going to replace PageReserved altogether */ |
1111 | vma->vm_flags |= VM_IO; | 1111 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
1112 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | ||
1113 | 1112 | ||
1114 | pos = usbvision->frame[i].data; | 1113 | pos = usbvision->frame[i].data; |
1115 | while (size > 0) { | 1114 | while (size > 0) { |
diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c index f300deafd268..828e7c10bd70 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c | |||
@@ -582,7 +582,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
582 | map->count = 1; | 582 | map->count = 1; |
583 | map->q = q; | 583 | map->q = q; |
584 | vma->vm_ops = &videobuf_vm_ops; | 584 | vma->vm_ops = &videobuf_vm_ops; |
585 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 585 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
586 | vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */ | 586 | vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */ |
587 | vma->vm_private_data = map; | 587 | vma->vm_private_data = map; |
588 | dprintk(1, "mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n", | 588 | dprintk(1, "mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n", |
diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c index df142580e44c..2ff7fcc77b11 100644 --- a/drivers/media/v4l2-core/videobuf-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf-vmalloc.c | |||
@@ -270,7 +270,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
270 | } | 270 | } |
271 | 271 | ||
272 | vma->vm_ops = &videobuf_vm_ops; | 272 | vma->vm_ops = &videobuf_vm_ops; |
273 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 273 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
274 | vma->vm_private_data = map; | 274 | vma->vm_private_data = map; |
275 | 275 | ||
276 | dprintk(1, "mmap %p: q=%p %08lx-%08lx (%lx) pgoff %08lx buf %d\n", | 276 | dprintk(1, "mmap %p: q=%p %08lx-%08lx (%lx) pgoff %08lx buf %d\n", |
diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c index 504cd4cbe29e..051ea3571b20 100644 --- a/drivers/media/v4l2-core/videobuf2-memops.c +++ b/drivers/media/v4l2-core/videobuf2-memops.c | |||
@@ -163,7 +163,7 @@ int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long paddr, | |||
163 | return ret; | 163 | return ret; |
164 | } | 164 | } |
165 | 165 | ||
166 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 166 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
167 | vma->vm_private_data = priv; | 167 | vma->vm_private_data = priv; |
168 | vma->vm_ops = vm_ops; | 168 | vma->vm_ops = vm_ops; |
169 | 169 | ||
diff --git a/drivers/misc/carma/carma-fpga.c b/drivers/misc/carma/carma-fpga.c index 0c43297ed9ac..8835eabb3b87 100644 --- a/drivers/misc/carma/carma-fpga.c +++ b/drivers/misc/carma/carma-fpga.c | |||
@@ -1243,8 +1243,6 @@ static int data_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1243 | return -EINVAL; | 1243 | return -EINVAL; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | /* IO memory (stop cacheing) */ | ||
1247 | vma->vm_flags |= VM_IO | VM_RESERVED; | ||
1248 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 1246 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
1249 | 1247 | ||
1250 | return io_remap_pfn_range(vma, vma->vm_start, addr, vsize, | 1248 | return io_remap_pfn_range(vma, vma->vm_start, addr, vsize, |
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index ecafa4ba238b..492c8cac69ac 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -108,9 +108,8 @@ static int gru_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
108 | vma->vm_end & (GRU_GSEG_PAGESIZE - 1)) | 108 | vma->vm_end & (GRU_GSEG_PAGESIZE - 1)) |
109 | return -EINVAL; | 109 | return -EINVAL; |
110 | 110 | ||
111 | vma->vm_flags |= | 111 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_LOCKED | |
112 | (VM_IO | VM_DONTCOPY | VM_LOCKED | VM_DONTEXPAND | VM_PFNMAP | | 112 | VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP; |
113 | VM_RESERVED); | ||
114 | vma->vm_page_prot = PAGE_SHARED; | 113 | vma->vm_page_prot = PAGE_SHARED; |
115 | vma->vm_ops = &gru_vm_ops; | 114 | vma->vm_ops = &gru_vm_ops; |
116 | 115 | ||
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index a6e74514e662..73ae81a629f2 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -1182,7 +1182,7 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) | |||
1182 | return -EINVAL; | 1182 | return -EINVAL; |
1183 | if (set_vm_offset(vma, off) < 0) | 1183 | if (set_vm_offset(vma, off) < 0) |
1184 | return -EINVAL; | 1184 | return -EINVAL; |
1185 | vma->vm_flags |= VM_IO | VM_RESERVED; | 1185 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
1186 | 1186 | ||
1187 | #ifdef pgprot_noncached | 1187 | #ifdef pgprot_noncached |
1188 | if (file->f_flags & O_DSYNC || off >= __pa(high_memory)) | 1188 | if (file->f_flags & O_DSYNC || off >= __pa(high_memory)) |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 9c5c5f2b3962..be2c9a6561ff 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1257,7 +1257,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | sfp->mmap_called = 1; | 1259 | sfp->mmap_called = 1; |
1260 | vma->vm_flags |= VM_RESERVED; | 1260 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1261 | vma->vm_private_data = sfp; | 1261 | vma->vm_private_data = sfp; |
1262 | vma->vm_ops = &sg_mmap_vm_ops; | 1262 | vma->vm_ops = &sg_mmap_vm_ops; |
1263 | return 0; | 1263 | return 0; |
diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c index 42728e0cc194..c6f3ef6f57b9 100644 --- a/drivers/staging/omapdrm/omap_gem_dmabuf.c +++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c | |||
@@ -160,7 +160,7 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer, | |||
160 | goto out_unlock; | 160 | goto out_unlock; |
161 | } | 161 | } |
162 | 162 | ||
163 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND; | 163 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; |
164 | vma->vm_ops = obj->dev->driver->gem_vm_ops; | 164 | vma->vm_ops = obj->dev->driver->gem_vm_ops; |
165 | vma->vm_private_data = obj; | 165 | vma->vm_private_data = obj; |
166 | vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); | 166 | vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); |
diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c index bddea1d3b2c3..701a11ac676d 100644 --- a/drivers/staging/tidspbridge/rmgr/drv_interface.c +++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c | |||
@@ -261,7 +261,7 @@ static int bridge_mmap(struct file *filp, struct vm_area_struct *vma) | |||
261 | { | 261 | { |
262 | u32 status; | 262 | u32 status; |
263 | 263 | ||
264 | vma->vm_flags |= VM_RESERVED | VM_IO; | 264 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
265 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 265 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
266 | 266 | ||
267 | dev_dbg(bridge, "%s: vm filp %p start %lx end %lx page_prot %ulx " | 267 | dev_dbg(bridge, "%s: vm filp %p start %lx end %lx page_prot %ulx " |
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index a783d533a1a6..5110f367f1f1 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -653,8 +653,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma) | |||
653 | if (mi < 0) | 653 | if (mi < 0) |
654 | return -EINVAL; | 654 | return -EINVAL; |
655 | 655 | ||
656 | vma->vm_flags |= VM_IO | VM_RESERVED; | ||
657 | |||
658 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 656 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
659 | 657 | ||
660 | return remap_pfn_range(vma, | 658 | return remap_pfn_range(vma, |
@@ -666,7 +664,7 @@ static int uio_mmap_physical(struct vm_area_struct *vma) | |||
666 | 664 | ||
667 | static int uio_mmap_logical(struct vm_area_struct *vma) | 665 | static int uio_mmap_logical(struct vm_area_struct *vma) |
668 | { | 666 | { |
669 | vma->vm_flags |= VM_RESERVED; | 667 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
670 | vma->vm_ops = &uio_vm_ops; | 668 | vma->vm_ops = &uio_vm_ops; |
671 | uio_vma_open(vma); | 669 | uio_vma_open(vma); |
672 | return 0; | 670 | return 0; |
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 91cd85076a44..9a62e89d6dc0 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -1247,7 +1247,7 @@ static int mon_bin_mmap(struct file *filp, struct vm_area_struct *vma) | |||
1247 | { | 1247 | { |
1248 | /* don't do anything here: "fault" will set up page table entries */ | 1248 | /* don't do anything here: "fault" will set up page table entries */ |
1249 | vma->vm_ops = &mon_bin_vm_ops; | 1249 | vma->vm_ops = &mon_bin_vm_ops; |
1250 | vma->vm_flags |= VM_RESERVED; | 1250 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1251 | vma->vm_private_data = filp->private_data; | 1251 | vma->vm_private_data = filp->private_data; |
1252 | mon_bin_vma_open(vma); | 1252 | mon_bin_vma_open(vma); |
1253 | return 0; | 1253 | return 0; |
diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c index a425d65d5ba2..fa44fbed397d 100644 --- a/drivers/video/68328fb.c +++ b/drivers/video/68328fb.c | |||
@@ -400,7 +400,7 @@ static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
400 | #ifndef MMU | 400 | #ifndef MMU |
401 | /* this is uClinux (no MMU) specific code */ | 401 | /* this is uClinux (no MMU) specific code */ |
402 | 402 | ||
403 | vma->vm_flags |= VM_RESERVED; | 403 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
404 | vma->vm_start = videomemory; | 404 | vma->vm_start = videomemory; |
405 | 405 | ||
406 | return 0; | 406 | return 0; |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 3f2e8c13f1ca..868932f904ef 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -1942,8 +1942,7 @@ static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
1942 | off = vma->vm_pgoff << PAGE_SHIFT; | 1942 | off = vma->vm_pgoff << PAGE_SHIFT; |
1943 | size = vma->vm_end - vma->vm_start; | 1943 | size = vma->vm_end - vma->vm_start; |
1944 | 1944 | ||
1945 | /* To stop the swapper from even considering these pages. */ | 1945 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
1946 | vma->vm_flags |= (VM_IO | VM_RESERVED); | ||
1947 | 1946 | ||
1948 | if (((vma->vm_pgoff == 0) && (size == info->fix.smem_len)) || | 1947 | if (((vma->vm_pgoff == 0) && (size == info->fix.smem_len)) || |
1949 | ((off == info->fix.smem_len) && (size == PAGE_SIZE))) | 1948 | ((off == info->fix.smem_len) && (size == PAGE_SIZE))) |
diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c index 60a787fa32cf..7d106f1f4906 100644 --- a/drivers/video/fb-puv3.c +++ b/drivers/video/fb-puv3.c | |||
@@ -653,9 +653,8 @@ int unifb_mmap(struct fb_info *info, | |||
653 | vma->vm_page_prot)) | 653 | vma->vm_page_prot)) |
654 | return -EAGAIN; | 654 | return -EAGAIN; |
655 | 655 | ||
656 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | 656 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
657 | return 0; | 657 | return 0; |
658 | |||
659 | } | 658 | } |
660 | 659 | ||
661 | static struct fb_ops unifb_ops = { | 660 | static struct fb_ops unifb_ops = { |
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 64cda560c488..88cad6b8b479 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c | |||
@@ -166,7 +166,7 @@ static const struct address_space_operations fb_deferred_io_aops = { | |||
166 | static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) | 166 | static int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) |
167 | { | 167 | { |
168 | vma->vm_ops = &fb_deferred_io_vm_ops; | 168 | vma->vm_ops = &fb_deferred_io_vm_ops; |
169 | vma->vm_flags |= ( VM_RESERVED | VM_DONTEXPAND ); | 169 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
170 | if (!(info->flags & FBINFO_VIRTFB)) | 170 | if (!(info->flags & FBINFO_VIRTFB)) |
171 | vma->vm_flags |= VM_IO; | 171 | vma->vm_flags |= VM_IO; |
172 | vma->vm_private_data = info; | 172 | vma->vm_private_data = info; |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0dff12a1daef..3ff0105a496a 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1410,8 +1410,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) | |||
1410 | return -EINVAL; | 1410 | return -EINVAL; |
1411 | off += start; | 1411 | off += start; |
1412 | vma->vm_pgoff = off >> PAGE_SHIFT; | 1412 | vma->vm_pgoff = off >> PAGE_SHIFT; |
1413 | /* This is an IO map - tell maydump to skip this VMA */ | 1413 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by io_remap_pfn_range()*/ |
1414 | vma->vm_flags |= VM_IO | VM_RESERVED; | ||
1415 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | 1414 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); |
1416 | fb_pgprotect(file, vma, off); | 1415 | fb_pgprotect(file, vma, off); |
1417 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | 1416 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, |
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 7e7b7a9ba274..05e2a8a99d8f 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -1024,7 +1024,7 @@ static int gbefb_mmap(struct fb_info *info, | |||
1024 | pgprot_val(vma->vm_page_prot) = | 1024 | pgprot_val(vma->vm_page_prot) = |
1025 | pgprot_fb(pgprot_val(vma->vm_page_prot)); | 1025 | pgprot_fb(pgprot_val(vma->vm_page_prot)); |
1026 | 1026 | ||
1027 | vma->vm_flags |= VM_IO | VM_RESERVED; | 1027 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
1028 | 1028 | ||
1029 | /* look for the starting tile */ | 1029 | /* look for the starting tile */ |
1030 | tile = &gbe_tiles.cpu[offset >> TILE_SHIFT]; | 1030 | tile = &gbe_tiles.cpu[offset >> TILE_SHIFT]; |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 3c39aa8de928..15373f4aee19 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1128,7 +1128,7 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) | |||
1128 | DBG("user mmap region start %lx, len %d, off %lx\n", start, len, off); | 1128 | DBG("user mmap region start %lx, len %d, off %lx\n", start, len, off); |
1129 | 1129 | ||
1130 | vma->vm_pgoff = off >> PAGE_SHIFT; | 1130 | vma->vm_pgoff = off >> PAGE_SHIFT; |
1131 | vma->vm_flags |= VM_IO | VM_RESERVED; | 1131 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
1132 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 1132 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
1133 | vma->vm_ops = &mmap_user_ops; | 1133 | vma->vm_ops = &mmap_user_ops; |
1134 | vma->vm_private_data = rg; | 1134 | vma->vm_private_data = rg; |
diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c index 3c1de981a18c..296afae442f4 100644 --- a/drivers/video/sbuslib.c +++ b/drivers/video/sbuslib.c | |||
@@ -57,9 +57,8 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map, | |||
57 | 57 | ||
58 | off = vma->vm_pgoff << PAGE_SHIFT; | 58 | off = vma->vm_pgoff << PAGE_SHIFT; |
59 | 59 | ||
60 | /* To stop the swapper from even considering these pages */ | 60 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ |
61 | vma->vm_flags |= (VM_IO | VM_RESERVED); | 61 | |
62 | |||
63 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 62 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
64 | 63 | ||
65 | /* Each page, see which map applies */ | 64 | /* Each page, see which map applies */ |
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index 5533a32c6ca1..97bd6620c364 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c | |||
@@ -803,7 +803,6 @@ static int ufx_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
803 | size = 0; | 803 | size = 0; |
804 | } | 804 | } |
805 | 805 | ||
806 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | ||
807 | return 0; | 806 | return 0; |
808 | } | 807 | } |
809 | 808 | ||
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 8af64148294b..f45eba3d6150 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c | |||
@@ -345,7 +345,6 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
345 | size = 0; | 345 | size = 0; |
346 | } | 346 | } |
347 | 347 | ||
348 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | ||
349 | return 0; | 348 | return 0; |
350 | } | 349 | } |
351 | 350 | ||
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c index 970e43d13f52..89aef343e295 100644 --- a/drivers/video/vermilion/vermilion.c +++ b/drivers/video/vermilion/vermilion.c | |||
@@ -1018,7 +1018,6 @@ static int vmlfb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
1018 | offset += vinfo->vram_start; | 1018 | offset += vinfo->vram_start; |
1019 | pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; | 1019 | pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; |
1020 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; | 1020 | pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT; |
1021 | vma->vm_flags |= VM_RESERVED | VM_IO; | ||
1022 | if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT, | 1021 | if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT, |
1023 | size, vma->vm_page_prot)) | 1022 | size, vma->vm_page_prot)) |
1024 | return -EAGAIN; | 1023 | return -EAGAIN; |
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 501a922aa9dc..c7f692525b88 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c | |||
@@ -439,7 +439,6 @@ static int vfb_mmap(struct fb_info *info, | |||
439 | size = 0; | 439 | size = 0; |
440 | } | 440 | } |
441 | 441 | ||
442 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | ||
443 | return 0; | 442 | return 0; |
444 | 443 | ||
445 | } | 444 | } |
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index 934985d14c24..4097987b330e 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c | |||
@@ -535,7 +535,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma) | |||
535 | 535 | ||
536 | vma->vm_private_data = vm_priv; | 536 | vma->vm_private_data = vm_priv; |
537 | 537 | ||
538 | vma->vm_flags |= VM_RESERVED | VM_DONTEXPAND; | 538 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
539 | 539 | ||
540 | vma->vm_ops = &gntalloc_vmops; | 540 | vma->vm_ops = &gntalloc_vmops; |
541 | 541 | ||
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 5df9fd847b2e..610bfc6be177 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
@@ -720,7 +720,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) | |||
720 | 720 | ||
721 | vma->vm_ops = &gntdev_vmops; | 721 | vma->vm_ops = &gntdev_vmops; |
722 | 722 | ||
723 | vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND; | 723 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
724 | 724 | ||
725 | if (use_ptemod) | 725 | if (use_ptemod) |
726 | vma->vm_flags |= VM_DONTCOPY; | 726 | vma->vm_flags |= VM_DONTCOPY; |
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index ef6389580b8c..8adb9cc267f9 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c | |||
@@ -455,7 +455,8 @@ static int privcmd_mmap(struct file *file, struct vm_area_struct *vma) | |||
455 | { | 455 | { |
456 | /* DONTCOPY is essential for Xen because copy_page_range doesn't know | 456 | /* DONTCOPY is essential for Xen because copy_page_range doesn't know |
457 | * how to recreate these mappings */ | 457 | * how to recreate these mappings */ |
458 | vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP; | 458 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTCOPY | |
459 | VM_DONTEXPAND | VM_DONTDUMP; | ||
459 | vma->vm_ops = &privcmd_vm_ops; | 460 | vma->vm_ops = &privcmd_vm_ops; |
460 | vma->vm_private_data = NULL; | 461 | vma->vm_private_data = NULL; |
461 | 462 | ||
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 2b72d26e2e4b..e800dec958c3 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1135,7 +1135,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, | |||
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | /* Do not dump I/O mapped devices or special mappings */ | 1137 | /* Do not dump I/O mapped devices or special mappings */ |
1138 | if (vma->vm_flags & (VM_IO | VM_RESERVED)) | 1138 | if (vma->vm_flags & VM_IO) |
1139 | return 0; | 1139 | return 0; |
1140 | 1140 | ||
1141 | /* By default, dump shared memory if mapped from an anonymous file. */ | 1141 | /* By default, dump shared memory if mapped from an anonymous file. */ |
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 08d812b32282..262db114ff01 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -1205,7 +1205,7 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags) | |||
1205 | int dump_ok; | 1205 | int dump_ok; |
1206 | 1206 | ||
1207 | /* Do not dump I/O mapped devices or special mappings */ | 1207 | /* Do not dump I/O mapped devices or special mappings */ |
1208 | if (vma->vm_flags & (VM_IO | VM_RESERVED)) { | 1208 | if (vma->vm_flags & VM_IO) { |
1209 | kdcore("%08lx: %08lx: no (IO)", vma->vm_start, vma->vm_flags); | 1209 | kdcore("%08lx: %08lx: no (IO)", vma->vm_start, vma->vm_flags); |
1210 | return 0; | 1210 | return 0; |
1211 | } | 1211 | } |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 9460120a5170..0a0ab8e21b19 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -110,7 +110,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
110 | * way when do_mmap_pgoff unwinds (may be important on powerpc | 110 | * way when do_mmap_pgoff unwinds (may be important on powerpc |
111 | * and ia64). | 111 | * and ia64). |
112 | */ | 112 | */ |
113 | vma->vm_flags |= VM_HUGETLB | VM_RESERVED; | 113 | vma->vm_flags |= VM_HUGETLB | VM_DONTEXPAND | VM_DONTDUMP; |
114 | vma->vm_ops = &hugetlb_vm_ops; | 114 | vma->vm_ops = &hugetlb_vm_ops; |
115 | 115 | ||
116 | if (vma->vm_pgoff & (~huge_page_mask(h) >> PAGE_SHIFT)) | 116 | if (vma->vm_pgoff & (~huge_page_mask(h) >> PAGE_SHIFT)) |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 4540b8f76f16..79827ce03e3b 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -54,7 +54,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) | |||
54 | "VmPTE:\t%8lu kB\n" | 54 | "VmPTE:\t%8lu kB\n" |
55 | "VmSwap:\t%8lu kB\n", | 55 | "VmSwap:\t%8lu kB\n", |
56 | hiwater_vm << (PAGE_SHIFT-10), | 56 | hiwater_vm << (PAGE_SHIFT-10), |
57 | (total_vm - mm->reserved_vm) << (PAGE_SHIFT-10), | 57 | total_vm << (PAGE_SHIFT-10), |
58 | mm->locked_vm << (PAGE_SHIFT-10), | 58 | mm->locked_vm << (PAGE_SHIFT-10), |
59 | mm->pinned_vm << (PAGE_SHIFT-10), | 59 | mm->pinned_vm << (PAGE_SHIFT-10), |
60 | hiwater_rss << (PAGE_SHIFT-10), | 60 | hiwater_rss << (PAGE_SHIFT-10), |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 95b738c7abff..ba7a0ff19d39 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -239,7 +239,7 @@ extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | |||
239 | /* Check if a vma is migratable */ | 239 | /* Check if a vma is migratable */ |
240 | static inline int vma_migratable(struct vm_area_struct *vma) | 240 | static inline int vma_migratable(struct vm_area_struct *vma) |
241 | { | 241 | { |
242 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | 242 | if (vma->vm_flags & (VM_IO | VM_HUGETLB | VM_PFNMAP)) |
243 | return 0; | 243 | return 0; |
244 | /* | 244 | /* |
245 | * Migration allocates pages in the highest zone. If we cannot | 245 | * Migration allocates pages in the highest zone. If we cannot |
diff --git a/include/linux/mm.h b/include/linux/mm.h index dc08d558e058..0514fe9d3c84 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -96,7 +96,6 @@ extern unsigned int kobjsize(const void *objp); | |||
96 | 96 | ||
97 | #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ | 97 | #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ |
98 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ | 98 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ |
99 | #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ | ||
100 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 99 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
101 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | 100 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ |
102 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 101 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
@@ -148,7 +147,7 @@ extern unsigned int kobjsize(const void *objp); | |||
148 | * Special vmas that are non-mergable, non-mlock()able. | 147 | * Special vmas that are non-mergable, non-mlock()able. |
149 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. | 148 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. |
150 | */ | 149 | */ |
151 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) | 150 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP) |
152 | 151 | ||
153 | /* | 152 | /* |
154 | * mapping from the currently active vm_flags protection bits (the | 153 | * mapping from the currently active vm_flags protection bits (the |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 58d3173eb365..a57a43f5ca7c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -349,7 +349,6 @@ struct mm_struct { | |||
349 | unsigned long shared_vm; /* Shared pages (files) */ | 349 | unsigned long shared_vm; /* Shared pages (files) */ |
350 | unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ | 350 | unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ |
351 | unsigned long stack_vm; /* VM_GROWSUP/DOWN */ | 351 | unsigned long stack_vm; /* VM_GROWSUP/DOWN */ |
352 | unsigned long reserved_vm; /* VM_RESERVED|VM_IO pages */ | ||
353 | unsigned long def_flags; | 352 | unsigned long def_flags; |
354 | unsigned long nr_ptes; /* Page table pages */ | 353 | unsigned long nr_ptes; /* Page table pages */ |
355 | unsigned long start_code, end_code, start_data, end_data; | 354 | unsigned long start_code, end_code, start_data, end_data; |
diff --git a/kernel/events/core.c b/kernel/events/core.c index f16f3c58f11a..cda3ebd49e86 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -3671,7 +3671,7 @@ unlock: | |||
3671 | atomic_inc(&event->mmap_count); | 3671 | atomic_inc(&event->mmap_count); |
3672 | mutex_unlock(&event->mmap_mutex); | 3672 | mutex_unlock(&event->mmap_mutex); |
3673 | 3673 | ||
3674 | vma->vm_flags |= VM_RESERVED; | 3674 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3675 | vma->vm_ops = &perf_mmap_vmops; | 3675 | vma->vm_ops = &perf_mmap_vmops; |
3676 | 3676 | ||
3677 | return ret; | 3677 | return ret; |
@@ -1469,8 +1469,7 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | |||
1469 | */ | 1469 | */ |
1470 | if (*vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE | | 1470 | if (*vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE | |
1471 | VM_PFNMAP | VM_IO | VM_DONTEXPAND | | 1471 | VM_PFNMAP | VM_IO | VM_DONTEXPAND | |
1472 | VM_RESERVED | VM_HUGETLB | | 1472 | VM_HUGETLB | VM_NONLINEAR | VM_MIXEDMAP)) |
1473 | VM_NONLINEAR | VM_MIXEDMAP)) | ||
1474 | return 0; /* just ignore the advice */ | 1473 | return 0; /* just ignore the advice */ |
1475 | 1474 | ||
1476 | #ifdef VM_SAO | 1475 | #ifdef VM_SAO |
diff --git a/mm/memory.c b/mm/memory.c index 7b1e4feaec06..e09c04813186 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2297,14 +2297,13 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, | |||
2297 | * rest of the world about it: | 2297 | * rest of the world about it: |
2298 | * VM_IO tells people not to look at these pages | 2298 | * VM_IO tells people not to look at these pages |
2299 | * (accesses can have side effects). | 2299 | * (accesses can have side effects). |
2300 | * VM_RESERVED is specified all over the place, because | ||
2301 | * in 2.4 it kept swapout's vma scan off this vma; but | ||
2302 | * in 2.6 the LRU scan won't even find its pages, so this | ||
2303 | * flag means no more than count its pages in reserved_vm, | ||
2304 | * and omit it from core dump, even when VM_IO turned off. | ||
2305 | * VM_PFNMAP tells the core MM that the base pages are just | 2300 | * VM_PFNMAP tells the core MM that the base pages are just |
2306 | * raw PFN mappings, and do not have a "struct page" associated | 2301 | * raw PFN mappings, and do not have a "struct page" associated |
2307 | * with them. | 2302 | * with them. |
2303 | * VM_DONTEXPAND | ||
2304 | * Disable vma merging and expanding with mremap(). | ||
2305 | * VM_DONTDUMP | ||
2306 | * Omit vma from core dump, even when VM_IO turned off. | ||
2308 | * | 2307 | * |
2309 | * There's a horrible special case to handle copy-on-write | 2308 | * There's a horrible special case to handle copy-on-write |
2310 | * behaviour that some programs depend on. We mark the "original" | 2309 | * behaviour that some programs depend on. We mark the "original" |
@@ -2321,7 +2320,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, | |||
2321 | if (err) | 2320 | if (err) |
2322 | return -EINVAL; | 2321 | return -EINVAL; |
2323 | 2322 | ||
2324 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | 2323 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; |
2325 | 2324 | ||
2326 | BUG_ON(addr >= end); | 2325 | BUG_ON(addr >= end); |
2327 | pfn -= addr >> PAGE_SHIFT; | 2326 | pfn -= addr >> PAGE_SHIFT; |
diff --git a/mm/mlock.c b/mm/mlock.c index ef726e8aa8e9..a948be4b7ba7 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
@@ -227,7 +227,7 @@ long mlock_vma_pages_range(struct vm_area_struct *vma, | |||
227 | if (vma->vm_flags & (VM_IO | VM_PFNMAP)) | 227 | if (vma->vm_flags & (VM_IO | VM_PFNMAP)) |
228 | goto no_mlock; | 228 | goto no_mlock; |
229 | 229 | ||
230 | if (!((vma->vm_flags & (VM_DONTEXPAND | VM_RESERVED)) || | 230 | if (!((vma->vm_flags & VM_DONTEXPAND) || |
231 | is_vm_hugetlb_page(vma) || | 231 | is_vm_hugetlb_page(vma) || |
232 | vma == get_gate_vma(current->mm))) { | 232 | vma == get_gate_vma(current->mm))) { |
233 | 233 | ||
@@ -945,8 +945,6 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags, | |||
945 | mm->exec_vm += pages; | 945 | mm->exec_vm += pages; |
946 | } else if (flags & stack_flags) | 946 | } else if (flags & stack_flags) |
947 | mm->stack_vm += pages; | 947 | mm->stack_vm += pages; |
948 | if (flags & (VM_RESERVED|VM_IO)) | ||
949 | mm->reserved_vm += pages; | ||
950 | } | 948 | } |
951 | #endif /* CONFIG_PROC_FS */ | 949 | #endif /* CONFIG_PROC_FS */ |
952 | 950 | ||
diff --git a/mm/nommu.c b/mm/nommu.c index 9c4a7b63a4df..12e84e69dd06 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1811,7 +1811,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, | |||
1811 | if (addr != (pfn << PAGE_SHIFT)) | 1811 | if (addr != (pfn << PAGE_SHIFT)) |
1812 | return -EINVAL; | 1812 | return -EINVAL; |
1813 | 1813 | ||
1814 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | 1814 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; |
1815 | return 0; | 1815 | return 0; |
1816 | } | 1816 | } |
1817 | EXPORT_SYMBOL(remap_pfn_range); | 1817 | EXPORT_SYMBOL(remap_pfn_range); |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 2bb90b1d241c..8de704679bfc 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -2163,8 +2163,7 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | |||
2163 | usize -= PAGE_SIZE; | 2163 | usize -= PAGE_SIZE; |
2164 | } while (usize > 0); | 2164 | } while (usize > 0); |
2165 | 2165 | ||
2166 | /* Prevent "things" like memory migration? VM_flags need a cleanup... */ | 2166 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
2167 | vma->vm_flags |= VM_RESERVED; | ||
2168 | 2167 | ||
2169 | return 0; | 2168 | return 0; |
2170 | } | 2169 | } |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 55af8c5b57e6..3a6e8731646c 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -485,7 +485,7 @@ static int sel_mmap_policy(struct file *filp, struct vm_area_struct *vma) | |||
485 | return -EACCES; | 485 | return -EACCES; |
486 | } | 486 | } |
487 | 487 | ||
488 | vma->vm_flags |= VM_RESERVED; | 488 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
489 | vma->vm_ops = &sel_mmap_policy_ops; | 489 | vma->vm_ops = &sel_mmap_policy_ops; |
490 | 490 | ||
491 | return 0; | 491 | return 0; |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 20554eff5a21..5e12e5bacbba 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -3039,7 +3039,7 @@ static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file | |||
3039 | return -EINVAL; | 3039 | return -EINVAL; |
3040 | area->vm_ops = &snd_pcm_vm_ops_status; | 3040 | area->vm_ops = &snd_pcm_vm_ops_status; |
3041 | area->vm_private_data = substream; | 3041 | area->vm_private_data = substream; |
3042 | area->vm_flags |= VM_RESERVED; | 3042 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3043 | return 0; | 3043 | return 0; |
3044 | } | 3044 | } |
3045 | 3045 | ||
@@ -3076,7 +3076,7 @@ static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file | |||
3076 | return -EINVAL; | 3076 | return -EINVAL; |
3077 | area->vm_ops = &snd_pcm_vm_ops_control; | 3077 | area->vm_ops = &snd_pcm_vm_ops_control; |
3078 | area->vm_private_data = substream; | 3078 | area->vm_private_data = substream; |
3079 | area->vm_flags |= VM_RESERVED; | 3079 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3080 | return 0; | 3080 | return 0; |
3081 | } | 3081 | } |
3082 | #else /* ! coherent mmap */ | 3082 | #else /* ! coherent mmap */ |
@@ -3170,7 +3170,7 @@ static const struct vm_operations_struct snd_pcm_vm_ops_data_fault = { | |||
3170 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, | 3170 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, |
3171 | struct vm_area_struct *area) | 3171 | struct vm_area_struct *area) |
3172 | { | 3172 | { |
3173 | area->vm_flags |= VM_RESERVED; | 3173 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3174 | #ifdef ARCH_HAS_DMA_MMAP_COHERENT | 3174 | #ifdef ARCH_HAS_DMA_MMAP_COHERENT |
3175 | if (!substream->ops->page && | 3175 | if (!substream->ops->page && |
3176 | substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) | 3176 | substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV) |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index c4fd3b1d9592..d0323a693ba2 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -262,7 +262,7 @@ static int usb_stream_hwdep_mmap(struct snd_hwdep *hw, | |||
262 | } | 262 | } |
263 | 263 | ||
264 | area->vm_ops = &usb_stream_hwdep_vm_ops; | 264 | area->vm_ops = &usb_stream_hwdep_vm_ops; |
265 | area->vm_flags |= VM_RESERVED; | 265 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
266 | area->vm_private_data = us122l; | 266 | area->vm_private_data = us122l; |
267 | atomic_inc(&us122l->mmap_count); | 267 | atomic_inc(&us122l->mmap_count); |
268 | out: | 268 | out: |
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 04aafb43a13c..0b34dbc8f302 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c | |||
@@ -82,7 +82,7 @@ static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct v | |||
82 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; | 82 | us428->us428ctls_sharedmem->CtlSnapShotLast = -2; |
83 | } | 83 | } |
84 | area->vm_ops = &us428ctls_vm_ops; | 84 | area->vm_ops = &us428ctls_vm_ops; |
85 | area->vm_flags |= VM_RESERVED | VM_DONTEXPAND; | 85 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
86 | area->vm_private_data = hw->private_data; | 86 | area->vm_private_data = hw->private_data; |
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 8e40b6e67e9e..cc56007791e0 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c | |||
@@ -723,7 +723,7 @@ static int snd_usX2Y_hwdep_pcm_mmap(struct snd_hwdep * hw, struct file *filp, st | |||
723 | return -ENODEV; | 723 | return -ENODEV; |
724 | } | 724 | } |
725 | area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; | 725 | area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; |
726 | area->vm_flags |= VM_RESERVED | VM_DONTEXPAND; | 726 | area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
727 | area->vm_private_data = hw->private_data; | 727 | area->vm_private_data = hw->private_data; |
728 | return 0; | 728 | return 0; |
729 | } | 729 | } |