In order to detect VMA range changes, add a sequence count. Signed-off-by: Peter Zijlstra --- include/linux/mm_types.h | 2 ++ mm/mmap.c | 10 ++++++++++ 2 files changed, 12 insertions(+) Index: linux-2.6/include/linux/mm_types.h =================================================================== --- linux-2.6.orig/include/linux/mm_types.h +++ linux-2.6/include/linux/mm_types.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -186,6 +187,7 @@ struct vm_area_struct { #ifdef CONFIG_NUMA struct mempolicy *vm_policy; /* NUMA policy for the VMA */ #endif + seqcount_t vm_sequence; }; struct core_thread { Index: linux-2.6/mm/mmap.c =================================================================== --- linux-2.6.orig/mm/mmap.c +++ linux-2.6/mm/mmap.c @@ -512,6 +512,10 @@ void vma_adjust(struct vm_area_struct *v long adjust_next = 0; int remove_next = 0; + write_seqcount_begin(&vma->vm_sequence); + if (next) + write_seqcount_begin(&next->vm_sequence); + if (next && !insert) { if (end >= next->vm_end) { /* @@ -647,11 +651,17 @@ again: remove_next = 1 + (end > next-> * up the code too much to do both in one go. */ if (remove_next == 2) { + write_seqcount_end(&next->vm_sequence); next = vma->vm_next; + write_seqcount_begin(&next->vm_sequence); goto again; } } + if (next) + write_seqcount_end(&next->vm_sequence); + write_seqcount_end(&vma->vm_sequence); + validate_mm(mm); } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/