On Tue, Dec 04, 2012 at 11:13:40AM -0800, John Stultz wrote:I don't think the problem is when vmas being marked VM_VOLATILE areUnderstood. Thanks.
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).
Below patch solves your problems? It's simple than yours.
Anyway, both yours and mine are not right fix.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?
As I mentioned, locking scheme is broken.
We need anon_vma_lock to handle purged and we should consider fork
case, too.