Re: [PATCH -v2] rmap: make anon_vma_prepare link in all the anon_vmasof a mergeable VMA

From: Linus Torvalds
Date: Sat Apr 10 2010 - 16:45:50 EST




On Sat, 10 Apr 2010, Borislav Petkov wrote:
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Date: Sat, Apr 10, 2010 at 01:12:46PM -0700
>
> > So I'm actually pretty optimistic that this really is it.
>
> Ok, let me verify what/in which order should be tested before I test
> something wrongly. The RCU-safe fix for the TLB flush can stay for
> correctness reasons, this last patch, obviosly, what happens with the
> find_mergeable_anon_vma() changes to use only singleton lists for
> merging? Should I keep those too?

Yes. So the patches I actually think are important are:

- the RCU fix is real, although admittedly the race window is probably
too small to ever really hit.

- the simplification rule to find_mergeable_anon_vma's is required,
because otherwise our anon_vma_merge() will do the wrong thing (maybe
Johannes' patch would be an alternative, but quite frankly, I think we
want the simpler code, and I don't think we even _want_ to share
anon_vma's that are complex due to forking)

I like my "cleanup" version (the bigger one with lots of comments) more
than the two-liner version, but they should be equivalent.

- the vma_adjust() fix is the one that I think may actually end up fixing
your problems for good. Knock wood.

So I think they are all required, but I suspect that the vma_adjust() one
is finally the most direct explanation of the problem you've seen.

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