Skip to contentSkip to conversation

codetag-avoid-unused-alloc_tags-sections-symbols.patch removed from -mm tree

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

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: codetag: avoid unused alloc_tags sections/symbols
has been removed from the -mm tree. Its filename was
codetag-avoid-unused-alloc_tags-sections-symbols.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: Petr Pavlu <[email protected]>
Subject: codetag: avoid unused alloc_tags sections/symbols
Date: Wed, 18 Jun 2025 14:50:35 +0200

With CONFIG_MEM_ALLOC_PROFILING=n, vmlinux and all modules unnecessarily contain the symbols __start_alloc_tags and __stop_alloc_tags, which define an empty range. In the case of modules, the presence of these symbols also forces the linker to create an empty .codetag.alloc_tags section.

Update codetag.lds.h to make the data conditional on CONFIG_MEM_ALLOC_PROFILING.

---

 include/asm-generic/codetag.lds.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
include/asm-generic/codetag.lds.h renamed from include/asm-generic/codetag.lds.h~codetag-avoid-unused-alloc_tags-sections-symbols +8 -2
@@ -2,6 +2,12 @@
 #ifndef __ASM_GENERIC_CODETAG_LDS_H
 #define __ASM_GENERIC_CODETAG_LDS_H
 
+#ifdef CONFIG_MEM_ALLOC_PROFILING
+#define IF_MEM_ALLOC_PROFILING(...) __VA_ARGS__
+#else
+#define IF_MEM_ALLOC_PROFILING(...)
+#endif
+
 #define SECTION_WITH_BOUNDARIES(_name)	\
 	. = ALIGN(8);			\
 	__start_##_name = .;		\
@@ -9,7 +15,7 @@
 	__stop_##_name = .;
 
 #define CODETAG_SECTIONS()		\
-	SECTION_WITH_BOUNDARIES(alloc_tags)
+	IF_MEM_ALLOC_PROFILING(SECTION_WITH_BOUNDARIES(alloc_tags))
 
 #define MOD_SEPARATE_CODETAG_SECTION(_name)	\
 	.codetag.##_name : {			\
@@ -22,6 +28,6 @@
  * unload them individually once unused.
  */
 #define MOD_SEPARATE_CODETAG_SECTIONS()		\
-	MOD_SEPARATE_CODETAG_SECTION(alloc_tags)
+	IF_MEM_ALLOC_PROFILING(MOD_SEPARATE_CODETAG_SECTION(alloc_tags))
 
 #endif /* __ASM_GENERIC_CODETAG_LDS_H */

_

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