]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/bootmem_info: remove call to kmemleak_free_part_phys()
authorDavid Hildenbrand (Arm) <david@kernel.org>
Mon, 11 May 2026 14:05:32 +0000 (16:05 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 2 Jun 2026 22:22:11 +0000 (15:22 -0700)
The call to kmemleak_free_part_phys() was added in 2022 in
commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in
put_page_bootmem").

In 2025, commit b2aad24b5333 ("mm/memmap: prevent double scanning of memmap
by kmemleak") started to use MEMBLOCK_ALLOC_NOLEAKTRACE when allocating
the memmap to skip the kmemleak_alloc_phys() in the buddy.

So remove the call to kmemleak_free_part_phys(). If this would still
be required for other purposes, either free_reserved_page() should take
care of it, or selected users.

Link: https://lore.kernel.org/20260511-bootmem_info_prep-v1-4-3fb0be6fc688@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Tested-by: Lance Yang <lance.yang@linux.dev>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/bootmem_info.h
mm/bootmem_info.c

index 492ceeb1cdf89af0a60c6caa2c2c713bf1eb2851..f724340755e553545586f49f113a7f4adff8a35d 100644 (file)
@@ -82,7 +82,6 @@ static inline void get_page_bootmem(unsigned long info, struct page *page,
 
 static inline void free_bootmem_page(struct page *page)
 {
-       kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE);
        free_reserved_page(page);
 }
 #endif
index 6e2aaab3dca9e92fba791574cd77f9b01417de3c..74c1116626c8c9ff8c8a91fe744258b59eb01430 100644 (file)
@@ -32,7 +32,6 @@ void put_page_bootmem(struct page *page)
 
        if (page_ref_dec_return(page) == 1) {
                set_page_private(page, 0);
-               kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE);
                free_reserved_page(page);
        }
 }