All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters.patch added to mm-new branch
@ 2025-06-03  3:10 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-06-03  3:10 UTC (permalink / raw)
  To: mm-commits, surenb, kent.overstreet, gehao, akpm


The patch titled
     Subject: mm/alloc_tag: add the ARCH_NEEDS_WEAK_PER_CPU macro when statically defining the percpu variable alloc_tag_counters.
has been added to the -mm mm-new branch.  Its filename is
     mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Hao Ge <gehao@kylinos.cn>
Subject: mm/alloc_tag: add the ARCH_NEEDS_WEAK_PER_CPU macro when statically defining the percpu variable alloc_tag_counters.
Date: Thu, 29 May 2025 15:35:37 +0800

Recently discovered this entry while checking kallsyms on ARM64:
ffff800083e509c0 D _shared_alloc_tag

If ARCH_NEEDS_WEAK_PER_CPU is not defined,there's no need to statically
define the percpu variable alloc_tag_counters.

Therefore, add the relevant macro guards at the appropriate location.

Link: https://lkml.kernel.org/r/20250529073537.563107-1-hao.ge@linux.dev
Fixes: 22d407b164ff ("lib: add allocation tagging support for memory allocation profiling")
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/alloc_tag.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/lib/alloc_tag.c~mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters
+++ a/lib/alloc_tag.c
@@ -24,8 +24,10 @@ static bool mem_profiling_support;
 
 static struct codetag_type *alloc_tag_cttype;
 
+#ifdef ARCH_NEEDS_WEAK_PER_CPU
 DEFINE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag);
 EXPORT_SYMBOL(_shared_alloc_tag);
+#endif /* ARCH_NEEDS_WEAK_PER_CPU */
 
 DEFINE_STATIC_KEY_MAYBE(CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT,
 			mem_alloc_profiling_key);
_

Patches currently in -mm which might be from gehao@kylinos.cn are

mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-03  3:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03  3:10 + mm-alloc_tag-add-the-arch_needs_weak_per_cpu-macro-when-statically-defining-the-percpu-variable-alloc_tag_counters.patch added to mm-new branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.