Skip to contentSkip to conversation

alloc_tag: Export memory allocation profiling symbols used by modules

PATCH In review Suren Baghdasaryan 3 participants 6 messages Jul 11, 2024 – Jul 17, 2024

Subsystems (3)
lore
Share & tools
lore

Suren Baghdasaryan

author reviewer
#0 lore raw

PATCH 1/1 alloc_tag: Export memory allocation profiling symbols used by modules

Export mem_alloc_profiling_key, page_ext_get() and page_ext_set() symbols as they can be used by modules (mem_alloc_profiling_key is used indirectly via mem_alloc_profiling_enabled()).

---
 lib/alloc_tag.c | 1 +
 mm/page_ext.c   | 2 ++
 2 files changed, 3 insertions(+)
lib/alloc_tag.c +1 -0
index c347b8b72d78..c01f9f4e92f2 100644
@@ -15,6 +15,7 @@ EXPORT_SYMBOL(_shared_alloc_tag);
 
 DEFINE_STATIC_KEY_MAYBE(CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT,
 			mem_alloc_profiling_key);
+EXPORT_SYMBOL(mem_alloc_profiling_key);
 
 struct allocinfo_private {
 	struct codetag_iterator iter;
mm/page_ext.c +2 -0
index 95dd8ffeaf81..57a198c70f98 100644
@@ -527,6 +527,7 @@ struct page_ext *page_ext_get(const struct page *page)
 
 	return page_ext;
 }
+EXPORT_SYMBOL(page_ext_get);
 
 /**
  * page_ext_put() - Working with page extended information is done.
@@ -545,3 +546,4 @@ void page_ext_put(struct page_ext *page_ext)
 
 	rcu_read_unlock();
 }
+EXPORT_SYMBOL(page_ext_put);

base-commit: 9d9a2f29aefdadc86e450308ff056017a209c755

Signature · 1 line
2.45.2.993.g49e7a77208-goog
maintainer
#1 lore raw
Quoted 3 lines · On Thu, 11 Jul 2024 13:46:26 -0700 Suren Baghdasaryan <[email protected]> wrote:

Export mem_alloc_profiling_key, page_ext_get() and page_ext_set() symbols as they can be used by modules (mem_alloc_profiling_key is used indirectly via mem_alloc_profiling_enabled()).

Thanks, I'll add

Fixes 22d407b164ff ("lib: add allocation tagging support for memory allocation profiling").
author reviewer
#2 lore raw
Quoted 10 lines · Andrew Morton
Quoted 3 lines · On Thu, 11 Jul 2024 13:46:26 -0700 Suren Baghdasaryan <[email protected]> wrote:

Export mem_alloc_profiling_key, page_ext_get() and page_ext_set() symbols as they can be used by modules (mem_alloc_profiling_key is used indirectly via mem_alloc_profiling_enabled()).

Thanks, I'll add

Fixes 22d407b164ff ("lib: add allocation tagging support for memory allocation profiling").

Perfect. Thank you!

#3 lore raw
In reply to Suren Baghdasaryan

mm/page_ext.c struct page_ext *page_ext_get(const struct page *page)

Quoted 3 lines · Suren Baghdasaryan
mm/page_ext.c +2 -0
+EXPORT_SYMBOL(page_ext_get);
 
+EXPORT_SYMBOL(page_ext_put);

These really have no business being exported, especially non-GPL. Please rework whatever interfaces need them to be be moved out of line.

author reviewer
#4 lore raw
Quoted 8 lines · Christoph Hellwig

mm/page_ext.c struct page_ext *page_ext_get(const struct page *page)

Quoted 3 lines · Suren Baghdasaryan
mm/page_ext.c +2 -0
+EXPORT_SYMBOL(page_ext_get);
 
+EXPORT_SYMBOL(page_ext_put);

These really have no business being exported, especially non-GPL. Please rework whatever interfaces need them to be be moved out of line.

Ok, I can do that. Thanks for the feedback!

Quoted 1 line
author reviewer
#5 lore raw
Quoted 4 lines · Suren Baghdasaryan
Quoted 2 lines · Christoph Hellwig

On Thu, Jul 11, 2024 at 01:46:26PM -0700, Suren Baghdasaryan wrote:

Quoted 8 lines
Quoted 6 lines

mm/page_ext.c struct page_ext *page_ext_get(const struct page *page)

Quoted 3 lines
mm/page_ext.c +2 -0
+EXPORT_SYMBOL(page_ext_get);
 
+EXPORT_SYMBOL(page_ext_put);

These really have no business being exported, especially non-GPL. Please rework whatever interfaces need them to be be moved out of line.

Ok, I can do that. Thanks for the feedback!

Replacement patches are posted at
https://lore.kernel.org/all/[email protected]

Andrew, could you please replace this older patch with the new patchset (2 patches now)? I can see the old patch in mm-unstable as ac5ca7954e4e ("alloc_tag: export memory allocation profiling symbols used by modules") and I think it's also in your mm-hotfixes-stable. Please replace it with new patches.
Thanks,
Suren.

Quoted 2 lines
Quoted 2 lines