Thread (30 messages) 30 messages, 7 authors, 2012-12-11

Re: [RFC v2] Support volatile range for anon vma

From: Minchan Kim <minchan@kernel.org>
Date: 2012-12-11 04:40:47
Also in: lkml

On Fri, Dec 07, 2012 at 04:49:56PM -0800, John Stultz wrote:
On 12/04/2012 08:18 PM, Minchan Kim wrote:
quoted
On Tue, Dec 04, 2012 at 11:13:40AM -0800, John Stultz wrote:
quoted
I don't think the problem is when vmas being marked VM_VOLATILE are
being merged, its that when we mark the vma as *non-volatile*, and
remove the VM_VOLATILE flag we merge the non-volatile vmas with
neighboring vmas. So preserving the purged flag during that merge is
important. Again, the example I used to trigger this was an
alternating pattern of volatile and non volatile vmas, then marking
the entire range non-volatile (though sometimes in two overlapping
passes).
Understood. Thanks.
Below patch solves your problems? It's simple than yours.
Yea, this is nicer then my fix.
Although I still need the purged handling in the vma merge code for
me to see the behavior I expect in my tests.

I've integrated your patch and repushed my queue here:
http://git.linaro.org/gitweb?p=people/jstultz/android-dev.git;a=shortlog;h=refs/heads/dev/minchan-anonvol

git://git.linaro.org/people/jstultz/android-dev.git dev/minchan-anonvol
quoted
Anyway, both yours and mine are not right fix.
As I mentioned, locking scheme is broken.
We need anon_vma_lock to handle purged and we should consider fork
case, too.
Hrm. I'm sure you're right, as I've not yet fully grasped all the
locking rules here.  Could you clarify how it is broken? And why is
the anon_vma_lock needed to manage the purged state that is part of
the vma itself?
If you don't hold anon->lock, merge/split/fork can race with try_to_unmap
so vma->[purged|vm_flags] would lose consistency.
thanks
-john

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help