linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] madvise anon_name cleanups
@ 2025-06-24 13:03 Vlastimil Babka
  2025-06-24 13:03 ` [PATCH v2 1/4] mm, madvise: simplify anon_name handling Vlastimil Babka
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Vlastimil Babka @ 2025-06-24 13:03 UTC (permalink / raw)
  To: Andrew Morton, Liam R. Howlett, Lorenzo Stoakes,
	David Hildenbrand, Jann Horn, Mike Rapoport, Suren Baghdasaryan,
	Michal Hocko, Colin Cross
  Cc: linux-mm, linux-kernel, Vlastimil Babka

While reviewing Lorenzo's madvise cleanups I've noticed that we can
handle anon_name in madvise code much better, so sending that as patch
1. Initially I wanted to do first move the existing logic from
madvise_vma_behavior() to madvise_update_vma() as a separate patch
before the actual simplification but that would require adding
anon_vma_name_put() in error handling paths only to be removed again, so
it's a single patch to avoid churn.

It's also an opportunity to move some mm code from prctl under mm,
hence patch 2. After code moving preparation in patch 3, also unify
madvise lock handling for madvise_set_anon_name() in patch 4.

Based on mm-new.

Taking the RFC off as concerns from RFC should be addressed, but not
without risk as patches 3+4 are new. Due to rewrite of patch 1 I didn't
keep Suren's R-b (but thanks!).

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
Changes in v2:
- Refactor madvise_update_vma() to select between vma_modify_flags() and
  vma_modify_flags_name() based on Lorenzo's suggestion. This should
  also address Suren's concerns.
- Reduce the code move from kernel/sys.c to code handling
  PR_SET_VMA_ANON_NAME, per Lorenzo.
- Added patches 3, 4 to unify mm locking.
- Link to v1: https://patch.msgid.link/20250623-anon_name_cleanup-v1-0-04c94384046f@suse.cz

---
Vlastimil Babka (4):
      mm, madvise: simplify anon_name handling
      mm, madvise: extract mm code from prctl_set_vma() to mm/madvise.c
      mm, madvise: move madvise_set_anon_name() down the file
      mm, madvise: use standard madvise locking in madvise_set_anon_name()

 include/linux/mm.h |  14 ++---
 kernel/sys.c       |  50 +----------------
 mm/madvise.c       | 154 ++++++++++++++++++++++++++++++++++-------------------
 3 files changed, 106 insertions(+), 112 deletions(-)
---
base-commit: 4216fd45fc9156da0ee33fcb25cc0a5265049e32
change-id: 20250623-anon_name_cleanup-e89b687038ed

Best regards,
-- 
Vlastimil Babka <vbabka@suse.cz>


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

end of thread, other threads:[~2025-06-24 17:03 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 13:03 [PATCH v2 0/4] madvise anon_name cleanups Vlastimil Babka
2025-06-24 13:03 ` [PATCH v2 1/4] mm, madvise: simplify anon_name handling Vlastimil Babka
2025-06-24 13:58   ` David Hildenbrand
2025-06-24 14:28     ` Suren Baghdasaryan
2025-06-24 16:41       ` Vlastimil Babka
2025-06-24 16:38     ` Vlastimil Babka
2025-06-24 15:26   ` Lorenzo Stoakes
2025-06-24 16:42     ` Vlastimil Babka
2025-06-24 17:01   ` Vlastimil Babka
2025-06-24 13:03 ` [PATCH v2 2/4] mm, madvise: extract mm code from prctl_set_vma() to mm/madvise.c Vlastimil Babka
2025-06-24 14:04   ` David Hildenbrand
2025-06-24 14:31     ` Suren Baghdasaryan
2025-06-24 15:28   ` Lorenzo Stoakes
2025-06-24 13:03 ` [PATCH v2 3/4] mm, madvise: move madvise_set_anon_name() down the file Vlastimil Babka
2025-06-24 14:05   ` David Hildenbrand
2025-06-24 14:33     ` Suren Baghdasaryan
2025-06-24 16:46     ` Vlastimil Babka
2025-06-24 15:36   ` Lorenzo Stoakes
2025-06-24 17:02   ` Vlastimil Babka
2025-06-24 13:03 ` [PATCH v2 4/4] mm, madvise: use standard madvise locking in madvise_set_anon_name() Vlastimil Babka
2025-06-24 14:06   ` David Hildenbrand
2025-06-24 14:35     ` Suren Baghdasaryan
2025-06-24 15:45   ` Lorenzo Stoakes
2025-06-24 16:48     ` Vlastimil Babka
2025-06-24 17:03   ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).