Commit 68402ddc677005ed1b1359bbc1f279548cfc0928
Committed by
Linus Torvalds
1 parent
9f1a3cfcff
[PATCH] mm: remove VM_LOCKED before remap_pfn_range and drop VM_SHM
Remove VM_LOCKED before remap_pfn range from device drivers and get rid of VM_SHM. remap_pfn_range() already sets VM_IO. There is no need to set VM_SHM since it does nothing. VM_LOCKED is of no use since the remap_pfn_range does not place pages on the LRU. The pages are therefore never subject to swap anyways. Remove all the vm_flags settings before calling remap_pfn_range. After removing all the vm_flag settings no use of VM_SHM is left. Drop it. Signed-off-by: Christoph Lameter <clameter@sgi.com> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 14 changed files with 1 additions and 32 deletions Side-by-side Diff
- arch/arm/kernel/bios32.c
- arch/cris/arch-v32/drivers/pci/bios.c
- arch/i386/pci/i386.c
- arch/ia64/pci/pci.c
- arch/powerpc/kernel/pci_32.c
- arch/powerpc/kernel/pci_64.c
- arch/powerpc/kernel/proc_ppc64.c
- arch/ppc/kernel/pci.c
- arch/xtensa/kernel/pci.c
- drivers/char/mmtimer.c
- drivers/sbus/char/flash.c
- drivers/sbus/char/vfc_dev.c
- drivers/video/igafb.c
- include/linux/mm.h
arch/arm/kernel/bios32.c
arch/cris/arch-v32/drivers/pci/bios.c
arch/i386/pci/i386.c
... | ... | @@ -285,8 +285,6 @@ |
285 | 285 | /* Leave vm_pgoff as-is, the PCI space address is the physical |
286 | 286 | * address on this platform. |
287 | 287 | */ |
288 | - vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO); | |
289 | - | |
290 | 288 | prot = pgprot_val(vma->vm_page_prot); |
291 | 289 | if (boot_cpu_data.x86 > 3) |
292 | 290 | prot |= _PAGE_PCD | _PAGE_PWT; |
arch/ia64/pci/pci.c
... | ... | @@ -602,8 +602,6 @@ |
602 | 602 | * Leave vm_pgoff as-is, the PCI space address is the physical |
603 | 603 | * address on this platform. |
604 | 604 | */ |
605 | - vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); | |
606 | - | |
607 | 605 | if (write_combine && efi_range_is_wc(vma->vm_start, |
608 | 606 | vma->vm_end - vma->vm_start)) |
609 | 607 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
... | ... | @@ -666,7 +664,6 @@ |
666 | 664 | |
667 | 665 | vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT; |
668 | 666 | vma->vm_page_prot = prot; |
669 | - vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); | |
670 | 667 | |
671 | 668 | if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
672 | 669 | size, vma->vm_page_prot)) |
arch/powerpc/kernel/pci_32.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/proc_ppc64.c
arch/ppc/kernel/pci.c
arch/xtensa/kernel/pci.c
... | ... | @@ -350,17 +350,6 @@ |
350 | 350 | } |
351 | 351 | |
352 | 352 | /* |
353 | - * Set vm_flags of VMA, as appropriate for this architecture, for a pci device | |
354 | - * mapping. | |
355 | - */ | |
356 | -static __inline__ void | |
357 | -__pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma, | |
358 | - enum pci_mmap_state mmap_state) | |
359 | -{ | |
360 | - vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; | |
361 | -} | |
362 | - | |
363 | -/* | |
364 | 353 | * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci |
365 | 354 | * device mapping. |
366 | 355 | */ |
... | ... | @@ -399,7 +388,6 @@ |
399 | 388 | if (ret < 0) |
400 | 389 | return ret; |
401 | 390 | |
402 | - __pci_mmap_set_flags(dev, vma, mmap_state); | |
403 | 391 | __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); |
404 | 392 | |
405 | 393 | ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
drivers/char/mmtimer.c
drivers/sbus/char/flash.c
... | ... | @@ -71,7 +71,6 @@ |
71 | 71 | if (vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)) > size) |
72 | 72 | size = vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)); |
73 | 73 | |
74 | - vma->vm_flags |= (VM_SHM | VM_LOCKED); | |
75 | 74 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
76 | 75 | |
77 | 76 | if (io_remap_pfn_range(vma, vma->vm_start, addr, size, vma->vm_page_prot)) |
drivers/sbus/char/vfc_dev.c
... | ... | @@ -623,7 +623,7 @@ |
623 | 623 | map_size = sizeof(struct vfc_regs); |
624 | 624 | |
625 | 625 | vma->vm_flags |= |
626 | - (VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE); | |
626 | + (VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE); | |
627 | 627 | map_offset = (unsigned int) (long)dev->phys_regs; |
628 | 628 | ret = io_remap_pfn_range(vma, vma->vm_start, |
629 | 629 | MK_IOSPACE_PFN(dev->which_io, |
drivers/video/igafb.c
... | ... | @@ -232,9 +232,6 @@ |
232 | 232 | |
233 | 233 | size = vma->vm_end - vma->vm_start; |
234 | 234 | |
235 | - /* To stop the swapper from even considering these pages. */ | |
236 | - vma->vm_flags |= (VM_SHM | VM_LOCKED); | |
237 | - | |
238 | 235 | /* Each page, see which map applies */ |
239 | 236 | for (page = 0; page < size; ) { |
240 | 237 | map_size = 0; |
include/linux/mm.h
... | ... | @@ -145,7 +145,6 @@ |
145 | 145 | |
146 | 146 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ |
147 | 147 | #define VM_GROWSUP 0x00000200 |
148 | -#define VM_SHM 0x00000000 /* Means nothing: delete it later */ | |
149 | 148 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
150 | 149 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
151 | 150 |