alloc_tag: mark pages reserved during CMA activation as not tagged
PATCH 1/1 alloc_tag: mark pages reserved during CMA activation as not tagged
During CMA activation, pages in CMA area are prepared and then freed without being allocated. This triggers warnings when memory allocation debug config (CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this by marking these pages not tagged before freeing them.
--- mm/mm_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
mm/mm_init.c +10 -0
@@ -2245,6 +2245,16 @@ void __init init_cma_reserved_pageblock(struct page *page)set_pageblock_migratetype (page,MIGRATE_CMA );set_page_refcounted (page); + +/* pages were reserved and not allocated */ +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); + } + }__free_pages (page, pageblock_order);adjust_managed_page_count (page, pageblock_nr_pages);
base-commit: d74da846046aeec9333e802f5918bd3261fb5509
Signature · 1 line
2.46.0.76.ge559c4bf1a-goog
Quoted 5 lines · Suren Baghdasaryan
During CMA activation, pages in CMA area are prepared and then freed without being allocated. This triggers warnings when memory allocation debug config (
CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this by marking these pages not tagged before freeing them.
This should also have:
Quoted 32 lines
Signed-off-by Suren Baghdasaryan <[email protected]>--- mm/mm_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)mm/mm_init.c +10
-0@@ -2245,6 +2245,16 @@ void __init init_cma_reserved_pageblock(struct page *page)set_pageblock_migratetype (page,MIGRATE_CMA );set_page_refcounted (page); + +/* pages were reserved and not allocated */ +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); + } + }__free_pages (page, pageblock_order);adjust_managed_page_count (page, pageblock_nr_pages);base-commit:
d74da846046aeec9333e802f5918bd3261fb5509--
2.46.0.76.ge559c4bf1a-goog
Quoted 11 lines · Suren Baghdasaryan
Quoted 5 lines · Suren Baghdasaryan
During CMA activation, pages in CMA area are prepared and then freed without being allocated. This triggers warnings when memory allocation debug config (
CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this by marking these pages not tagged before freeing them.This should also have:
Fixes d224eb0287fb "codetag: debug: mark codetags for reserved pages as empty"
And Cc: [email protected] # v6.10
Let me post v2 with these corrections...
Quoted 33 lines
Quoted 33 lines
Signed-off-by Suren Baghdasaryan <[email protected]>--- mm/mm_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)mm/mm_init.c +10
-0@@ -2245,6 +2245,16 @@ void __init init_cma_reserved_pageblock(struct page *page)set_pageblock_migratetype (page,MIGRATE_CMA );set_page_refcounted (page); + +/* pages were reserved and not allocated */ +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); + } + }__free_pages (page, pageblock_order);adjust_managed_page_count (page, pageblock_nr_pages);base-commit:
d74da846046aeec9333e802f5918bd3261fb5509--
2.46.0.76.ge559c4bf1a-goog
Quoted 10 lines · Suren Baghdasaryan
Quoted 8 lines · Suren Baghdasaryan
Quoted 5 lines · Suren Baghdasaryan
During CMA activation, pages in CMA area are prepared and then freed without being allocated. This triggers warnings when memory allocation debug config (
CONFIG_MEM_ALLOC_PROFILING_DEBUG) is enabled. Fix this by marking these pages not tagged before freeing them.
Quoted 7 lines
Quoted 3 lines
This should also have:
Fixes d224eb0287fb "codetag: debug: mark codetags for reserved pages as empty"And Cc: [email protected] # v6.10
Let me post v2 with these corrections...
v2 with corrections posted at
https://lore.kernel.org/all/[email protected]/
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
Signed-off-by Suren Baghdasaryan <[email protected]>--- mm/mm_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)mm/mm_init.c +10
-0@@ -2245,6 +2245,16 @@ void __init init_cma_reserved_pageblock(struct page *page)set_pageblock_migratetype (page,MIGRATE_CMA );set_page_refcounted (page); + +/* pages were reserved and not allocated */ +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); + } + }__free_pages (page, pageblock_order);adjust_managed_page_count (page, pageblock_nr_pages);base-commit:
d74da846046aeec9333e802f5918bd3261fb5509--
2.46.0.76.ge559c4bf1a-goog