On 9/8/25 1:59 PM, Matthew Wilcox wrote:
On Mon, Sep 08, 2025 at 10:32:22PM +0200, David Hildenbrand wrote:
In the context of this series, how do we handle VMA-modifying functions like
mprotect/some madvise/mlock/mempolicy/...? Are they currently blocked when
applied to a mshare VMA?
I haven't been following this series recently, so I'm not sure what
Anthony will say. My expectation is that the shared VMA is somewhat
transparent to these operations; that is they are faulty if they span
the boundary of the mshare VMA, but otherwise they pass through and
affect the shared VMAs.
That does raise the interesting question of how mlockall() affects
an mshare VMA. I'm tempted to say that it should affect the shared
VMA, but reasonable people might well disagree with me and have
excellent arguments.
And how are we handling other page table walkers that don't modify VMAs like
MADV_DONTNEED, smaps, migrate_pages, ... etc?
I'd expect those to walk into the shared region too.
I've received conflicting feedback in previous discussions that things
like protection changes should be done via ioctl. I do thing somethings
are appropriate for ioctl like map and unmap, but I also like the idea
of the existing APIs being transparent to mshare so long as they are
operating entirely with an mshare range and not crossing boundaries.