From: Mel Gorman on
On Thu, Apr 29, 2010 at 09:28:25AM +0900, Minchan Kim wrote:
> On Thu, Apr 29, 2010 at 5:57 AM, Rik van Riel <riel(a)redhat.com> 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...
> >
> > Unfortunately, this requires adding a new lock (mm->anon_vma_chain_lock),
> > otherwise we have an unavoidable lock ordering conflict. �This changes the
> > locking rules for the "same_vma" list to be either mm->mmap_sem for write,
> > or mm->mmap_sem for read plus the new mm->anon_vma_chain lock. �This limits
> > the place where the new lock is taken to 2 locations - anon_vma_prepare and
> > expand_downwards.
> >
> > Document the locking rules for the same_vma list in the anon_vma_chain and
> > remove the anon_vma_lock call from expand_upwards, which does not need it.
> >
> > Signed-off-by: Rik van Riel <riel(a)redhat.com>
>
> This patch makes things simple. So I like this.

Agreed.

> Actually, I wanted this all-at-once locks approach.
> But I was worried about that how the patch affects AIM 7 workload
> which is cause of anon_vma_chain about scalability by Rik.

I had similar concerns. I'm surprised how it worked out.

> But now Rik himself is sending the patch. So I assume the patch
> couldn't decrease scalability of the workload heavily.
>
> Let's wait result of test if Rik doesn't have a problem of AIM7.
>

--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Minchan Kim on
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/