Skip to contentSkip to conversation

alloc_tag-skip-pgalloc_tag_swap-if-profiling-is-disabled.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Jan 16, 2025 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: alloc_tag: skip pgalloc_tag_swap if profiling is disabled
has been removed from the -mm tree. Its filename was
alloc_tag-skip-pgalloc_tag_swap-if-profiling-is-disabled.patch

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

------------------------------------------------------
From: Suren Baghdasaryan <[email protected]>
Subject: alloc_tag: skip pgalloc_tag_swap if profiling is disabled
Date: Thu, 26 Dec 2024 13:16:39 -0800

When memory allocation profiling is disabled, there is no need to swap allocation tags during migration. Skip it to avoid unnecessary overhead.

Once I added these checks, the overhead of the mode when memory profiling is enabled but turned off went down by about 50%.

Fixes e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()")
Cc David Wang <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Yu Zhao <[email protected]>
Cc Zhenhua Huang <[email protected]>

---

 lib/alloc_tag.c |    3 +++
 1 file changed, 3 insertions(+)
lib/alloc_tag.c renamed from lib/alloc_tag.c~alloc_tag-skip-pgalloc_tag_swap-if-profiling-is-disabled +3 -0
@@ -195,6 +195,9 @@ void pgalloc_tag_swap(struct folio *new,
 	union codetag_ref ref_old, ref_new;
 	struct alloc_tag *tag_old, *tag_new;
 
+	if (!mem_alloc_profiling_enabled())
+		return;
+
 	tag_old = pgalloc_tag_get(&old->page);
 	if (!tag_old)
 		return;

_

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

alloc_tag-avoid-current-alloc_tag-manipulations-when-profiling-is-disabled.patch