Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186212
b: refs/heads/master
c: fc148a5
h: refs/heads/master
v: v3
  • Loading branch information
Rik van Riel authored and Linus Torvalds committed Mar 6, 2010
1 parent f2d58a1 commit 6c56a62
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c44b674323f4a2480dbeb65d4b487fa5f06f49e0
refs/heads/master: fc148a5f7e0532750c312385c7ee9fa3e9311f34
4 changes: 0 additions & 4 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ extern unsigned int kobjsize(const void *objp);
#define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */
#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
#ifdef CONFIG_MMU
#define VM_LOCK_RMAP 0x01000000 /* Do not follow this rmap (mmu mmap) */
#else
#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
#endif
#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */

Expand Down
15 changes: 0 additions & 15 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,7 @@ again: remove_next = 1 + (end > next->vm_end);
*/
if (importer && !importer->anon_vma) {
/* Block reverse map lookups until things are set up. */
importer->vm_flags |= VM_LOCK_RMAP;
if (anon_vma_clone(importer, vma)) {
importer->vm_flags &= ~VM_LOCK_RMAP;
return -ENOMEM;
}
importer->anon_vma = anon_vma;
Expand Down Expand Up @@ -618,11 +616,6 @@ again: remove_next = 1 + (end > next->vm_end);
__vma_unlink(mm, next, vma);
if (file)
__remove_shared_vm_struct(next, file, mapping);
/*
* This VMA is now dead, no need for rmap to follow it.
* Call anon_vma_merge below, outside of i_mmap_lock.
*/
next->vm_flags |= VM_LOCK_RMAP;
} else if (insert) {
/*
* split_vma has split insert from vma, and needs
Expand All @@ -635,20 +628,12 @@ again: remove_next = 1 + (end > next->vm_end);
if (mapping)
spin_unlock(&mapping->i_mmap_lock);

/*
* The current VMA has been set up. It is now safe for the
* rmap code to get from the pages to the ptes.
*/
if (anon_vma && importer)
importer->vm_flags &= ~VM_LOCK_RMAP;

if (remove_next) {
if (file) {
fput(file);
if (next->vm_flags & VM_EXECUTABLE)
removed_exe_file_vma(mm);
}
/* Protected by mmap_sem and VM_LOCK_RMAP. */
if (next->anon_vma)
anon_vma_merge(vma, next);
mm->map_count--;
Expand Down
12 changes: 0 additions & 12 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,6 @@ vma_address(struct page *page, struct vm_area_struct *vma)
/* page should be within @vma mapping range */
return -EFAULT;
}
if (unlikely(vma->vm_flags & VM_LOCK_RMAP)) {
/*
* This VMA is being unlinked or is not yet linked into the
* VMA tree. Do not try to follow this rmap. This race
* condition can result in page_referenced() ignoring a
* reference or in try_to_unmap() failing to unmap a page.
* The VMA cannot be freed under us because we hold the
* anon_vma->lock, which the munmap code takes while
* unlinking the anon_vmas from the VMA.
*/
return -EFAULT;
}
return address;
}

Expand Down

0 comments on commit 6c56a62

Please sign in to comment.