Skip to content

RFC mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings

David Hildenbrand io-uring linux-fsdevel linux-mm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/nommu: factor out check for NOMMU shared mappings into is_nommu_shared_mapping()drivers/char/mem.c fs/cramfs/inode.c fs/proc/task_nommu.c +5 more+27 -110 replies
2/2mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappingsinclude/linux/mm.h mm/nommu.c+36 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH mm-stable RFC 0/2] mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings

Trying to reduce the confusion around VM_SHARED and VM_MAYSHARE first requires !CONFIG_MMU to stop using VM_MAYSHARE for MAP_PRIVATE mappings. CONFIG_MMU only sets VM_MAYSHARE for MAP_SHARED mappings.

This paves the way for further VM_MAYSHARE and VM_SHARED cleanups: for example, renaming VM_MAYSHARED to VM_MAP_SHARED to make it cleaner what is actually means.

Let's first get the weird case out of the way and not use VM_MAYSHARE in MAP_PRIVATE mappings, using a new VM_MAYOVERLAY flag instead.

I am not a NOMMU expert, but my basic testing with risc64-nommu with buildroot under QEMU revealed no surprises.

Cc Linus Torvalds <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Jens Axboe <[email protected]>
Cc Pavel Begunkov <[email protected]>

David Hildenbrand (2):
mm/nommu: factor out check for NOMMU shared mappings into
is_nommu_shared_mapping()
mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings

 drivers/char/mem.c    |  2 +-
 fs/cramfs/inode.c     |  2 +-
 fs/proc/task_nommu.c  |  2 +-
 fs/ramfs/file-nommu.c |  2 +-
 fs/romfs/mmap-nommu.c |  2 +-
 include/linux/mm.h    | 20 ++++++++++++++
 io_uring/io_uring.c   |  2 +-
 mm/nommu.c            | 62 +++++++++++++++++++++++++------------------
 8 files changed, 62 insertions(+), 32 deletions(-)
Signature · 1 line
2.38.1