Skip to contentSkip to conversation

FAILED: patch "[PATCH] alloc_tag: skip pgalloc_tag_swap if profiling is disabled" failed to apply to 6.12-stable tree

PATCH [email protected] 1 participant 1 message Jan 20, 2025

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 05c82ee363f64c64b87a0cfd744298e9333475f5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025012056-marina-lagging-26cc@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 05c82ee363f64c64b87a0cfd744298e9333475f5 Mon Sep 17 00:00:00 2001
From: Suren Baghdasaryan <[email protected]>
Date: Thu, 26 Dec 2024 13:16:39 -0800
Subject: [PATCH] alloc_tag: skip pgalloc_tag_swap if profiling is disabled

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 -0
index 7dcebf118a3e..65e706e1bc19 100644
@@ -195,6 +195,9 @@ void pgalloc_tag_swap(struct folio *new, struct folio *old)
 	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;