From: Suren Baghdasaryan <surenb@google.com>
To: akpm@linux-foundation.org
Cc: kent.overstreet@linux.dev, yuzhao@google.com, 00107082@163.com,
quic_zhenhuah@quicinc.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Suren Baghdasaryan <surenb@google.com>,
stable@vger.kernel.org
Subject: [PATCH 2/2] alloc_tag: skip pgalloc_tag_swap if profiling is disabled
Date: Thu, 26 Dec 2024 13:16:39 -0800 [thread overview]
Message-ID: <20241226211639.1357704-2-surenb@google.com> (raw)
In-Reply-To: <20241226211639.1357704-1-surenb@google.com>
When memory allocation profiling is disabled, there is no need to swap
allocation tags during migration. Skip it to avoid unnecessary overhead.
Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: stable@vger.kernel.org
---
lib/alloc_tag.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c
index 4c373f444eb1..4e5d7af3eaa2 100644
--- a/lib/alloc_tag.c
+++ b/lib/alloc_tag.c
@@ -197,6 +197,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;
--
2.47.1.613.gc27f4b7a9f-goog
next prev parent reply other threads:[~2024-12-26 21:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 21:16 [PATCH 1/2] alloc_tag: avoid current->alloc_tag manipulations when profiling is disabled Suren Baghdasaryan
2024-12-26 21:16 ` Suren Baghdasaryan [this message]
2024-12-26 23:01 ` [PATCH 2/2] alloc_tag: skip pgalloc_tag_swap if " Andrew Morton
2024-12-26 23:07 ` Suren Baghdasaryan
2024-12-27 0:23 ` Andrew Morton
2024-12-27 0:56 ` Suren Baghdasaryan
2024-12-27 7:59 ` Andrew Morton
2024-12-27 17:28 ` Suren Baghdasaryan
2024-12-27 17:32 ` Suren Baghdasaryan
2025-01-14 16:38 ` Suren Baghdasaryan
2025-01-15 1:10 ` Andrew Morton
2024-12-27 0:43 ` [PATCH 1/2] alloc_tag: avoid current->alloc_tag manipulations when " Kent Overstreet
2024-12-27 1:07 ` Suren Baghdasaryan
2024-12-27 1:09 ` Suren Baghdasaryan
2024-12-27 1:46 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241226211639.1357704-2-surenb@google.com \
--to=surenb@google.com \
--cc=00107082@163.com \
--cc=akpm@linux-foundation.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=quic_zhenhuah@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=yuzhao@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox