Linus Torvalds writes: (Summary)
So we do have three very distinct cases:
So we do have three very distinct cases:
(a) changing and thus splitting the vma itself (mprotect, munmap/mmap, mlock), (a) changing and thus splitting the vma itself (mprotect, munmap/mmap, mlock), (b) not changing the vma, but changing the underlying mapping (truncate and madvise(MADV_DONTNEED)
(truncate and madvise(MADV_DONTNEED)
(c) tearing down everything, and no locking needed because it's the last user (exit_mmap).
last user (exit_mmap).
that are different for what I think are good reasons.
So we do have three very distinct cases:
(a) changing and thus splitting the vma itself (mprotect, munmap/mmap, mlock), (a) changing and thus splitting the vma itself (mprotect, munmap/mmap, mlock), (b) not changing the vma, but changing the underlying mapping (truncate and madvise(MADV_DONTNEED)
(truncate and madvise(MADV_DONTNEED)
(c) tearing down everything, and no locking needed because it's the last user (exit_mmap).
last user (exit_mmap).
that are different for what I think are good reasons.