lkml.org 
[lkml]   [2010]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC PATCH -v3] take all anon_vma locks in anon_vma_lock
From
Date
On Thu, 2010-04-29 at 09:15 +0100, Mel Gorman wrote:
> On Wed, Apr 28, 2010 at 04:57:34PM -0400, Rik van Riel wrote:
> > Take all the locks for all the anon_vmas in anon_vma_lock, this properly
> > excludes migration and the transparent hugepage code from VMA changes done
> > by mmap/munmap/mprotect/expand_stack/etc...
> >
>
> In vma_adjust(), what prevents something like rmap_map seeing partial
> updates while the following lines execute?
>
> vma->vm_start = start;
> vma->vm_end = end;
> vma->vm_pgoff = pgoff;
> if (adjust_next) {
> next->vm_start += adjust_next << PAGE_SHIFT;
> next->vm_pgoff += adjust_next;
> }
> They would appear to happen outside the lock, even with this patch. The
> update happened within the lock in 2.6.33.
>
>
>
This part does it. :)

----
@@ -578,6 +578,7 @@ again: remove_next = 1 + (end >
next->vm_end);
}
}

+ anon_vma_lock(vma, &mm->mmap_sem);
if (root) {
flush_dcache_mmap_lock(mapping);
vma_prio_tree_remove(vma, root);
@@ -599,6 +600,7 @@ again: remove_next = 1 + (end >
next->vm_end);
vma_prio_tree_insert(vma, root);
flush_dcache_mmap_unlock(mapping);
}
+ anon_vma_unlock(vma);
---


But we still need patch about shift_arg_pages.


--
Kind regards,
Minchan Kim




\
 
 \ /
  Last update: 2010-04-30 21:31    [W:0.164 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site