public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH mm-unstable v1 0/3] mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings
@ 2023-01-02 16:08 David Hildenbrand
  2023-01-02 16:08 ` [PATCH mm-unstable v1 1/3] mm/nommu: factor out check for NOMMU shared mappings into is_nommu_shared_mapping() David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Hildenbrand @ 2023-01-02 16:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linux-fsdevel, io-uring, David Hildenbrand,
	Andrew Morton, Arnd Bergmann, Greg Kroah-Hartman, Nicolas Pitre,
	Jens Axboe, Pavel Begunkov

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: 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]>

RFC -> v1:
* Rebased, retested
* "drivers/misc/open-dice: don't touch VM_MAYSHARE"
 -> Added; as VM_MAYSHARE semantics are now clearer, it makes sense to
    include this change in this series.

David Hildenbrand (3):
  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/misc/open-dice: don't touch VM_MAYSHARE

 drivers/char/mem.c       |  2 +-
 drivers/misc/open-dice.c | 14 ++++-----
 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 +++++++++++++++++++++++-----------------
 9 files changed, 68 insertions(+), 40 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-02 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-02 16:08 [PATCH mm-unstable v1 0/3] mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings David Hildenbrand
2023-01-02 16:08 ` [PATCH mm-unstable v1 1/3] mm/nommu: factor out check for NOMMU shared mappings into is_nommu_shared_mapping() David Hildenbrand
2023-01-02 16:08 ` [PATCH mm-unstable v1 2/3] mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings David Hildenbrand
2023-01-02 16:08 ` [PATCH mm-unstable v1 3/3] drivers/misc/open-dice: don't touch VM_MAYSHARE David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox