Skip to content

Commit 766c163

Browse files
surenbaghdasaryanakpm00
authored andcommitted
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. Link: https://lkml.kernel.org/r/[email protected] Fixes: d224eb0 ("codetag: debug: mark codetags for reserved pages as empty") Signed-off-by: Suren Baghdasaryan <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Kees Cook <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: Pasha Tatashin <[email protected]> Cc: Sourav Panda <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> [6.10] Signed-off-by: Andrew Morton <[email protected]>
1 parent a8fc28d commit 766c163

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mm/mm_init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,8 @@ void __init init_cma_reserved_pageblock(struct page *page)
22442244

22452245
set_pageblock_migratetype(page, MIGRATE_CMA);
22462246
set_page_refcounted(page);
2247+
/* pages were reserved and not allocated */
2248+
clear_page_tag_ref(page);
22472249
__free_pages(page, pageblock_order);
22482250

22492251
adjust_managed_page_count(page, pageblock_nr_pages);

0 commit comments

Comments
 (0)