Skip to contentSkip to conversation

mm-madvise-extract-mm-code-from-prctl_set_vma-to-mm-madvisec.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 13, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm, madvise: extract mm code from prctl_set_vma() to mm/madvise.c
has been removed from the -mm tree. Its filename was
mm-madvise-extract-mm-code-from-prctl_set_vma-to-mm-madvisec.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Vlastimil Babka <[email protected]>
Subject: mm, madvise: extract mm code from prctl_set_vma() to mm/madvise.c
Date: Tue, 24 Jun 2025 15:03:46 +0200

Setting anon_name is done via madvise_set_anon_name() and behaves a lot of like other madvise operations. However, apparently because madvise() has lacked the 4th argument and prctl() not, the userspace entry point has been implemented via prctl(PR_SET_VMA, ...) and handled first by prctl_set_vma().

Currently prctl_set_vma() lives in kernel/sys.c but setting the vma->anon_name is mm-specific code so extract it to a new set_anon_vma_name() function under mm. mm/madvise.c seems to be the most straightforward place as that's where madvise_set_anon_name() lives. Stop declaring the latter in mm.h and instead declare set_anon_vma_name().

---

 include/linux/mm.h |   14 +++++------
 kernel/sys.c       |   50 -----------------------------------------
 mm/madvise.c       |   52 +++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 58 insertions(+), 58 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-madvise-extract-mm-code-from-prctl_set_vma-to-mm-madvisec +7 -7
@@ -4059,14 +4059,14 @@ unsigned long wp_shared_mapping_range(st
 #endif
 
 #ifdef CONFIG_ANON_VMA_NAME
-int madvise_set_anon_name(struct mm_struct *mm, unsigned long start,
-			  unsigned long len_in,
-			  struct anon_vma_name *anon_name);
+int set_anon_vma_name(unsigned long addr, unsigned long size,
+		      const char __user *uname);
 #else
-static inline int
-madvise_set_anon_name(struct mm_struct *mm, unsigned long start,
-		      unsigned long len_in, struct anon_vma_name *anon_name) {
-	return 0;
+static inline
+int set_anon_vma_name(unsigned long addr, unsigned long size,
+		      const char __user *uname)
+{
+	return -EINVAL;
 }
 #endif
 
kernel/sys.c renamed from kernel/sys.c~mm-madvise-extract-mm-code-from-prctl_set_vma-to-mm-madvisec +1 -49

69 lines not on this page · raw message

mm/madvise.c renamed from mm/madvise.c~mm-madvise-extract-mm-code-from-prctl_set_vma-to-mm-madvisec +50 -2

61 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

mm-vmstat-remove-the-nr_writeback_temp-node_stat_item-counter.patch mm-vmstat-remove-the-nr_writeback_temp-node_stat_item-counter-fix.patch