alloc_tag: export mem_alloc_profiling_key used by modules
Subsystems (4)
Suren Baghdasaryan
reviewerPATCH v2 1/2 alloc_tag: export mem_alloc_profiling_key used by modules
Export mem_alloc_profiling_key as it is used by modules (indirectly via mem_alloc_profiling_enabled()).
---
Changes since v1 [1]
- Added Acked-by, per Vlastimil Babka
[1] https://lore.kernel.org/all/[email protected]/
lib/alloc_tag.c | 1 + 1 file changed, 1 insertion(+)
lib/alloc_tag.c +1 -0
@@ -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;
base-commit: 51835949dda3783d4639cfa74ce13a3c9829de00
Signature · 1 line
2.45.2.993.g49e7a77208-goog
Suren Baghdasaryan
reviewerPATCH v2 2/2 alloc_tag: outline and export free_reserved_page()
Outline and export free_reserved_page() because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.
---
Changes since v1 [1]
- Outlined and exported free_reserved_page() in place of {get|put}_page_tag_ref, per Vlastimil Babka
[1] https://lore.kernel.org/all/[email protected]/
include/linux/mm.h | 16 +--------------- mm/page_alloc.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-)
include/linux/mm.h +1 -15
@@ -3177,21 +3177,7 @@ extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);/* Free the reserved page into the buddy system, so it gets managed. */ -static inline void free_reserved_page (struct page *page) -{ -if (mem_alloc_profiling_enabled ()) { -union codetag_ref *ref =get_page_tag_ref (page); - -if (ref) { -set_codetag_empty (ref); -put_page_tag_ref (ref); - } - } -ClearPageReserved (page); -init_page_count (page); -__free_page (page); -adjust_managed_page_count (page,1 ); -} +void free_reserved_page (struct page *page);#define free_highmem_page (page) free_reserved_page(page)static inline void mark_page_reserved (struct page *page)
mm/page_alloc.c +17 -0
@@ -5805,6 +5805,23 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn pages; } +void free_reserved_page (struct page *page) +{ +if (mem_alloc_profiling_enabled ()) { +union codetag_ref *ref =get_page_tag_ref (page); + +if (ref) { +set_codetag_empty (ref); +put_page_tag_ref (ref); + } + } +ClearPageReserved (page); +init_page_count (page); +__free_page (page); +adjust_managed_page_count (page,1 ); +} +EXPORT_SYMBOL (free_reserved_page); +static int page_alloc_cpu_dead (unsigned int cpu) {struct zone *zone;
Signature · 1 line
2.45.2.993.g49e7a77208-goog
Re: [PATCH v2 2/2] alloc_tag: outline and export free_reserved_page()
Quoted 6 lines · Suren Baghdasaryan
Outline and export
free_reserved_page()because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.
Quoted 6 lines
Fixes dcfe378c81f7 ("lib: introduce support for page allocation tagging")Reported-by kernel test robot <[email protected]>Suggested-by Christoph Hellwig <[email protected]>Suggested-by Vlastimil Babka <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>
Are these two patches now stable@ material as 6.10 build is broken on ppc64 with alloc taging enabled?
Quoted 66 lines
---
Changes since v1 [1]
- Outlined and exportedfree_reserved_page()in place of {get|put}_page_tag_ref, per Vlastimil Babka[1] https://lore.kernel.org/all/[email protected]/
include/linux/mm.h | 16 +--------------- mm/page_alloc.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-)include/linux/mm.h +1
-15@@ -3177,21 +3177,7 @@ extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);/* Free the reserved page into the buddy system, so it gets managed. */ -static inline void free_reserved_page (struct page *page) -{ -if (mem_alloc_profiling_enabled ()) { -union codetag_ref *ref =get_page_tag_ref (page); - -if (ref) { -set_codetag_empty (ref); -put_page_tag_ref (ref); - } - } -ClearPageReserved (page); -init_page_count (page); -__free_page (page); -adjust_managed_page_count (page,1 ); -} +void free_reserved_page (struct page *page);#define free_highmem_page (page) free_reserved_page(page)static inline void mark_page_reserved (struct page *page)mm/page_alloc.c +17
-0@@ -5805,6 +5805,23 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn pages; } +void free_reserved_page (struct page *page) +{ +if (mem_alloc_profiling_enabled ()) { +union codetag_ref *ref =get_page_tag_ref (page); + +if (ref) { +set_codetag_empty (ref); +put_page_tag_ref (ref); + } + } +ClearPageReserved (page); +init_page_count (page); +__free_page (page); +adjust_managed_page_count (page,1 ); +} +EXPORT_SYMBOL (free_reserved_page); +static int page_alloc_cpu_dead (unsigned int cpu) {struct zone *zone;
Suren Baghdasaryan
reviewerRe: [PATCH v2 2/2] alloc_tag: outline and export free_reserved_page()
Quoted 15 lines · Vlastimil Babka
Quoted 6 lines · Suren Baghdasaryan
Outline and export
free_reserved_page()because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.Quoted 6 lines
Fixes dcfe378c81f7 ("lib: introduce support for page allocation tagging")Reported-by kernel test robot <[email protected]>Suggested-by Christoph Hellwig <[email protected]>Suggested-by Vlastimil Babka <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>
Quoted 4 lines
Acked-by Vlastimil Babka <[email protected]>Are these two patches now stable@ material as 6.10 build is broken on ppc64 with alloc taging enabled?
I tested them with that specific configuration mentioned in the bug report and with several usual ones I use.
Yeah, I guess from now on all such fixes should have
Quoted 68 lines
Quoted 67 lines
---
Changes since v1 [1]
- Outlined and exportedfree_reserved_page()in place of {get|put}_page_tag_ref, per Vlastimil Babka[1] https://lore.kernel.org/all/[email protected]/
include/linux/mm.h | 16 +--------------- mm/page_alloc.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-)include/linux/mm.h +1
-15@@ -3177,21 +3177,7 @@ extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);/* Free the reserved page into the buddy system, so it gets managed. */ -static inline void free_reserved_page (struct page *page) -{ -if (mem_alloc_profiling_enabled ()) { -union codetag_ref *ref =get_page_tag_ref (page); - -if (ref) { -set_codetag_empty (ref); -put_page_tag_ref (ref); - } - } -ClearPageReserved (page); -init_page_count (page); -__free_page (page); -adjust_managed_page_count (page,1 ); -} +void free_reserved_page (struct page *page);#define free_highmem_page (page) free_reserved_page(page)static inline void mark_page_reserved (struct page *page)mm/page_alloc.c +17
-0@@ -5805,6 +5805,23 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn pages; } +void free_reserved_page (struct page *page) +{ +if (mem_alloc_profiling_enabled ()) { +union codetag_ref *ref =get_page_tag_ref (page); + +if (ref) { +set_codetag_empty (ref); +put_page_tag_ref (ref); + } + } +ClearPageReserved (page); +init_page_count (page); +__free_page (page); +adjust_managed_page_count (page,1 ); +} +EXPORT_SYMBOL (free_reserved_page); +static int page_alloc_cpu_dead (unsigned int cpu) {struct zone *zone;
Re: [PATCH v2 2/2] alloc_tag: outline and export free_reserved_page()
Quoted 18 lines · Suren Baghdasaryan
Quoted 17 lines · Vlastimil Babka
Quoted 6 lines · Suren Baghdasaryan
Outline and export
free_reserved_page()because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.Quoted 6 lines
Fixes dcfe378c81f7 ("lib: introduce support for page allocation tagging")Reported-by kernel test robot <[email protected]>Suggested-by Christoph Hellwig <[email protected]>Suggested-by Vlastimil Babka <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>Acked-by Vlastimil Babka <[email protected]>
Quoted 8 lines
Quoted 2 lines
Are these two patches now stable@ material as 6.10 build is broken on ppc64 with alloc taging enabled?
I tested them with that specific configuration mentioned in the bug report and with several usual ones I use.
Yeah, I guess from now on all such fixes should haveCc [email protected] # v6.10
Right. BTW I have just realized that the way you did Patch 2/2 and outlined the whole free_reserved_page() (which is fair, it's an init-time function), mem_alloc_profiling_enabled() didn't stay inlined so Patch 1/2 is in fact not necessary anymore?
Suren Baghdasaryan
reviewerRe: [PATCH v2 2/2] alloc_tag: outline and export free_reserved_page()
Quoted 27 lines · Vlastimil Babka
Quoted 25 lines · Suren Baghdasaryan
Quoted 15 lines · Vlastimil Babka
Quoted 6 lines · Suren Baghdasaryan
Outline and export
free_reserved_page()because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.Quoted 6 lines
Fixes dcfe378c81f7 ("lib: introduce support for page allocation tagging")Reported-by kernel test robot <[email protected]>Suggested-by Christoph Hellwig <[email protected]>Suggested-by Vlastimil Babka <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>Quoted 4 lines
Acked-by Vlastimil Babka <[email protected]>Are these two patches now stable@ material as 6.10 build is broken on ppc64 with alloc taging enabled?
I tested them with that specific configuration mentioned in the bug report and with several usual ones I use.
Yeah, I guess from now on all such fixes should have
Quoted 6 lines
Quoted 1 line
Cc [email protected] # v6.10Right. BTW I have just realized that the way you did Patch 2/2 and outlined the whole
free_reserved_page()(which is fair, it's an init-time function),mem_alloc_profiling_enabled()didn't stay inlined so Patch 1/2 is in fact not necessary anymore?
Yeah, I think you are right, currently no module has reasons to use mem_alloc_profiling_enabled() directly. That might change in the future but we can add the export at the time it's needed. I checked and ppc64 build passes with just this patch. Let me post v3 with just this patch and Cc stable@.
Quoted 3 lines
Suren Baghdasaryan
reviewerRe: [PATCH v2 2/2] alloc_tag: outline and export free_reserved_page()
Quoted 36 lines · Suren Baghdasaryan
Quoted 27 lines · Vlastimil Babka
Quoted 25 lines · Suren Baghdasaryan
Quoted 15 lines · Vlastimil Babka
Quoted 6 lines · Suren Baghdasaryan
Outline and export
free_reserved_page()because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths.Quoted 6 lines
Fixes dcfe378c81f7 ("lib: introduce support for page allocation tagging")Reported-by kernel test robot <[email protected]>Suggested-by Christoph Hellwig <[email protected]>Suggested-by Vlastimil Babka <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>Quoted 4 lines
Acked-by Vlastimil Babka <[email protected]>Are these two patches now stable@ material as 6.10 build is broken on ppc64 with alloc taging enabled?
I tested them with that specific configuration mentioned in the bug report and with several usual ones I use.
Yeah, I guess from now on all such fixes should haveQuoted 6 lines
Quoted 1 line
Cc [email protected] # v6.10Right. BTW I have just realized that the way you did Patch 2/2 and outlined the whole
free_reserved_page()(which is fair, it's an init-time function),mem_alloc_profiling_enabled()didn't stay inlined so Patch 1/2 is in fact not necessary anymore?
Quoted 5 lines
Yeah, I think you are right, currently no module has reasons to use
mem_alloc_profiling_enabled()directly. That might change in the future but we can add the export at the time it's needed. I checked and ppc64 build passes with just this patch. Let me post v3 with just this patch and Cc stable@.
v3 posted at https://lore.kernel.org/all/[email protected]/
Quoted 5 lines
Quoted 5 lines