Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68402ddc authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

[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: default avatarChristoph Lameter <clameter@sgi.com>
Acked-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9f1a3cfc
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -702,7 +702,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
	/*
	/*
	 * Mark this as IO
	 * Mark this as IO
	 */
	 */
	vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);


	if (remap_pfn_range(vma, vma->vm_start, phys,
	if (remap_pfn_range(vma, vma->vm_start, phys,
+0 −2
Original line number Original line Diff line number Diff line
@@ -27,8 +27,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
	/* Leave vm_pgoff as-is, the PCI space address is the physical
	/* Leave vm_pgoff as-is, the PCI space address is the physical
	 * address on this platform.
	 * address on this platform.
	 */
	 */
	vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);

	prot = pgprot_val(vma->vm_page_prot);
	prot = pgprot_val(vma->vm_page_prot);
	vma->vm_page_prot = __pgprot(prot);
	vma->vm_page_prot = __pgprot(prot);


+0 −2
Original line number Original line Diff line number Diff line
@@ -285,8 +285,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
	/* Leave vm_pgoff as-is, the PCI space address is the physical
	/* Leave vm_pgoff as-is, the PCI space address is the physical
	 * address on this platform.
	 * address on this platform.
	 */
	 */
	vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);

	prot = pgprot_val(vma->vm_page_prot);
	prot = pgprot_val(vma->vm_page_prot);
	if (boot_cpu_data.x86 > 3)
	if (boot_cpu_data.x86 > 3)
		prot |= _PAGE_PCD | _PAGE_PWT;
		prot |= _PAGE_PCD | _PAGE_PWT;
+0 −3
Original line number Original line Diff line number Diff line
@@ -602,8 +602,6 @@ pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
	 * Leave vm_pgoff as-is, the PCI space address is the physical
	 * Leave vm_pgoff as-is, the PCI space address is the physical
	 * address on this platform.
	 * address on this platform.
	 */
	 */
	vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO);

	if (write_combine && efi_range_is_wc(vma->vm_start,
	if (write_combine && efi_range_is_wc(vma->vm_start,
					     vma->vm_end - vma->vm_start))
					     vma->vm_end - vma->vm_start))
		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
		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)


	vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT;
	vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT;
	vma->vm_page_prot = prot;
	vma->vm_page_prot = prot;
	vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO);


	if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
	if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
			    size, vma->vm_page_prot))
			    size, vma->vm_page_prot))
+0 −1
Original line number Original line Diff line number Diff line
@@ -1654,7 +1654,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
		return -EINVAL;
		return -EINVAL;


	vma->vm_pgoff = offset >> PAGE_SHIFT;
	vma->vm_pgoff = offset >> PAGE_SHIFT;
	vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
	vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp,
	vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp,
						  vma->vm_page_prot,
						  vma->vm_page_prot,
						  mmap_state, write_combine);
						  mmap_state, write_combine);
Loading