diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-06-25 08:46:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:55 -0400 |
commit | 68402ddc677005ed1b1359bbc1f279548cfc0928 (patch) | |
tree | 83da62a2b55e2ea7e0c46ed79c0d6498d36e1942 | |
parent | 9f1a3cfcffaed2fbb3206179295c79ca8289f5c3 (diff) |
[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>
-rw-r--r-- | arch/arm/kernel/bios32.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pci/bios.c | 2 | ||||
-rw-r--r-- | arch/i386/pci/i386.c | 2 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/proc_ppc64.c | 2 | ||||
-rw-r--r-- | arch/ppc/kernel/pci.c | 1 | ||||
-rw-r--r-- | arch/xtensa/kernel/pci.c | 12 | ||||
-rw-r--r-- | drivers/char/mmtimer.c | 1 | ||||
-rw-r--r-- | drivers/sbus/char/flash.c | 1 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 2 | ||||
-rw-r--r-- | drivers/video/igafb.c | 3 | ||||
-rw-r--r-- | include/linux/mm.h | 1 |
14 files changed, 1 insertions, 32 deletions
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index de606dfa8db9..302fc1401547 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -702,7 +702,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
702 | /* | 702 | /* |
703 | * Mark this as IO | 703 | * Mark this as IO |
704 | */ | 704 | */ |
705 | vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; | ||
706 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 705 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
707 | 706 | ||
708 | if (remap_pfn_range(vma, vma->vm_start, phys, | 707 | if (remap_pfn_range(vma, vma->vm_start, phys, |
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index 24bc149889b6..1e9d062103ae 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c | |||
@@ -27,8 +27,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
27 | /* Leave vm_pgoff as-is, the PCI space address is the physical | 27 | /* Leave vm_pgoff as-is, the PCI space address is the physical |
28 | * address on this platform. | 28 | * address on this platform. |
29 | */ | 29 | */ |
30 | vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO); | ||
31 | |||
32 | prot = pgprot_val(vma->vm_page_prot); | 30 | prot = pgprot_val(vma->vm_page_prot); |
33 | vma->vm_page_prot = __pgprot(prot); | 31 | vma->vm_page_prot = __pgprot(prot); |
34 | 32 | ||
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index 7852827a599b..a151f7a99f5e 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c | |||
@@ -285,8 +285,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
285 | /* Leave vm_pgoff as-is, the PCI space address is the physical | 285 | /* Leave vm_pgoff as-is, the PCI space address is the physical |
286 | * address on this platform. | 286 | * address on this platform. |
287 | */ | 287 | */ |
288 | vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO); | ||
289 | |||
290 | prot = pgprot_val(vma->vm_page_prot); | 288 | prot = pgprot_val(vma->vm_page_prot); |
291 | if (boot_cpu_data.x86 > 3) | 289 | if (boot_cpu_data.x86 > 3) |
292 | prot |= _PAGE_PCD | _PAGE_PWT; | 290 | prot |= _PAGE_PCD | _PAGE_PWT; |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 61dd8608da4f..77375a55da31 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -602,8 +602,6 @@ pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, | |||
602 | * Leave vm_pgoff as-is, the PCI space address is the physical | 602 | * Leave vm_pgoff as-is, the PCI space address is the physical |
603 | * address on this platform. | 603 | * address on this platform. |
604 | */ | 604 | */ |
605 | vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); | ||
606 | |||
607 | if (write_combine && efi_range_is_wc(vma->vm_start, | 605 | if (write_combine && efi_range_is_wc(vma->vm_start, |
608 | vma->vm_end - vma->vm_start)) | 606 | vma->vm_end - vma->vm_start)) |
609 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 607 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
@@ -666,7 +664,6 @@ pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma) | |||
666 | 664 | ||
667 | vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT; | 665 | vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT; |
668 | vma->vm_page_prot = prot; | 666 | vma->vm_page_prot = prot; |
669 | vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); | ||
670 | 667 | ||
671 | if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | 668 | if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
672 | size, vma->vm_page_prot)) | 669 | size, vma->vm_page_prot)) |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index c858eb4bef17..b5431ccf1147 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -1654,7 +1654,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
1654 | return -EINVAL; | 1654 | return -EINVAL; |
1655 | 1655 | ||
1656 | vma->vm_pgoff = offset >> PAGE_SHIFT; | 1656 | vma->vm_pgoff = offset >> PAGE_SHIFT; |
1657 | vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; | ||
1658 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, | 1657 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, |
1659 | vma->vm_page_prot, | 1658 | vma->vm_page_prot, |
1660 | mmap_state, write_combine); | 1659 | mmap_state, write_combine); |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 5ad87c426bed..247937dd8b73 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -877,7 +877,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
877 | return -EINVAL; | 877 | return -EINVAL; |
878 | 878 | ||
879 | vma->vm_pgoff = offset >> PAGE_SHIFT; | 879 | vma->vm_pgoff = offset >> PAGE_SHIFT; |
880 | vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; | ||
881 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, | 880 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, |
882 | vma->vm_page_prot, | 881 | vma->vm_page_prot, |
883 | mmap_state, write_combine); | 882 | mmap_state, write_combine); |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index 2b87f82df135..2ab8f2be911e 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
@@ -115,8 +115,6 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) | |||
115 | { | 115 | { |
116 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 116 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
117 | 117 | ||
118 | vma->vm_flags |= VM_SHM | VM_LOCKED; | ||
119 | |||
120 | if ((vma->vm_end - vma->vm_start) > dp->size) | 118 | if ((vma->vm_end - vma->vm_start) > dp->size) |
121 | return -EINVAL; | 119 | return -EINVAL; |
122 | 120 | ||
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 809673a36f7a..d20accf9650d 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -1032,7 +1032,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
1032 | return -EINVAL; | 1032 | return -EINVAL; |
1033 | 1033 | ||
1034 | vma->vm_pgoff = offset >> PAGE_SHIFT; | 1034 | vma->vm_pgoff = offset >> PAGE_SHIFT; |
1035 | vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO; | ||
1036 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, | 1035 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, |
1037 | vma->vm_page_prot, | 1036 | vma->vm_page_prot, |
1038 | mmap_state, write_combine); | 1037 | mmap_state, write_combine); |
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index de19501aa809..c6f471b9eaa0 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c | |||
@@ -350,17 +350,6 @@ __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma, | |||
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 | * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci | 353 | * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci |
365 | * device mapping. | 354 | * device mapping. |
366 | */ | 355 | */ |
@@ -399,7 +388,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
399 | if (ret < 0) | 388 | if (ret < 0) |
400 | return ret; | 389 | return ret; |
401 | 390 | ||
402 | __pci_mmap_set_flags(dev, vma, mmap_state); | ||
403 | __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); | 391 | __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine); |
404 | 392 | ||
405 | ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | 393 | ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index 1b05fa688996..d65b3109318a 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -329,7 +329,6 @@ static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma) | |||
329 | if (PAGE_SIZE > (1 << 16)) | 329 | if (PAGE_SIZE > (1 << 16)) |
330 | return -ENOSYS; | 330 | return -ENOSYS; |
331 | 331 | ||
332 | vma->vm_flags |= (VM_IO | VM_SHM | VM_LOCKED ); | ||
333 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 332 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
334 | 333 | ||
335 | mmtimer_addr = __pa(RTC_COUNTER_ADDR); | 334 | mmtimer_addr = __pa(RTC_COUNTER_ADDR); |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 5ae684c011f8..31b8a5f6116f 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -71,7 +71,6 @@ flash_mmap(struct file *file, struct vm_area_struct *vma) | |||
71 | if (vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)) > size) | 71 | if (vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)) > size) |
72 | size = vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)); | 72 | size = vma->vm_end - (vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT)); |
73 | 73 | ||
74 | vma->vm_flags |= (VM_SHM | VM_LOCKED); | ||
75 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 74 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
76 | 75 | ||
77 | if (io_remap_pfn_range(vma, vma->vm_start, addr, size, vma->vm_page_prot)) | 76 | if (io_remap_pfn_range(vma, vma->vm_start, addr, size, vma->vm_page_prot)) |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index dfdd6be551f3..ddcd330b9e89 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -623,7 +623,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) | |||
623 | map_size = sizeof(struct vfc_regs); | 623 | map_size = sizeof(struct vfc_regs); |
624 | 624 | ||
625 | vma->vm_flags |= | 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 | map_offset = (unsigned int) (long)dev->phys_regs; | 627 | map_offset = (unsigned int) (long)dev->phys_regs; |
628 | ret = io_remap_pfn_range(vma, vma->vm_start, | 628 | ret = io_remap_pfn_range(vma, vma->vm_start, |
629 | MK_IOSPACE_PFN(dev->which_io, | 629 | MK_IOSPACE_PFN(dev->which_io, |
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c index 6b88050d21bf..8a0c2d3d3805 100644 --- a/drivers/video/igafb.c +++ b/drivers/video/igafb.c | |||
@@ -232,9 +232,6 @@ static int igafb_mmap(struct fb_info *info, | |||
232 | 232 | ||
233 | size = vma->vm_end - vma->vm_start; | 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 | /* Each page, see which map applies */ | 235 | /* Each page, see which map applies */ |
239 | for (page = 0; page < size; ) { | 236 | for (page = 0; page < size; ) { |
240 | map_size = 0; | 237 | map_size = 0; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3b09444121d9..71c5d2f667ed 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -145,7 +145,6 @@ extern unsigned int kobjsize(const void *objp); | |||
145 | 145 | ||
146 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ | 146 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ |
147 | #define VM_GROWSUP 0x00000200 | 147 | #define VM_GROWSUP 0x00000200 |
148 | #define VM_SHM 0x00000000 /* Means nothing: delete it later */ | ||
149 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 148 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
150 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 149 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
151 | 150 | ||