[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250624-anon_name_cleanup-v2-0-600075462a11@suse.cz>
Date: Tue, 24 Jun 2025 15:03:44 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Andrew Morton <akpm@...ux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
David Hildenbrand <david@...hat.com>, Jann Horn <jannh@...gle.com>,
Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>, Colin Cross <ccross@...gle.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Vlastimil Babka <vbabka@...e.cz>
Subject: [PATCH v2 0/4] madvise anon_name cleanups
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@...e.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@...e.cz>
Powered by blists - more mailing lists