diff options
author | Michel Lespinasse <walken@google.com> | 2012-10-08 19:31:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 03:22:41 -0400 |
commit | 108d6642ad81bb1d62b401490a334d2c12397517 (patch) | |
tree | 27df7d1777d80b9dddeaefaac928b726ff82a816 /mm/mmap.c | |
parent | 9826a516ff77c5820e591211e4f3e58ff36f46be (diff) |
mm anon rmap: remove anon_vma_moveto_tail
mremap() had a clever optimization where move_ptes() did not take the
anon_vma lock to avoid a race with anon rmap users such as page migration.
Instead, the avc's were ordered in such a way that the origin vma was
always visited by rmap before the destination. This ordering and the use
of page table locks rmap usage safe. However, we want to replace the use
of linked lists in anon rmap with an interval tree, and this will make it
harder to impose such ordering as the interval tree will always be sorted
by the avc->vma->vm_pgoff value. For now, let's replace the
anon_vma_moveto_tail() ordering function with proper anon_vma locking in
move_ptes(). Once we have the anon interval tree in place, we will
re-introduce an optimization to avoid taking these locks in the most
common cases.
Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -2378,8 +2378,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, | |||
2378 | */ | 2378 | */ |
2379 | VM_BUG_ON(faulted_in_anon_vma); | 2379 | VM_BUG_ON(faulted_in_anon_vma); |
2380 | *vmap = new_vma; | 2380 | *vmap = new_vma; |
2381 | } else | 2381 | } |
2382 | anon_vma_moveto_tail(new_vma); | ||
2383 | } else { | 2382 | } else { |
2384 | new_vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); | 2383 | new_vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); |
2385 | if (new_vma) { | 2384 | if (new_vma) { |