]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/memmap: prevent double scanning of memmap by kmemleak
authorGuo Weikang <guoweikang.kernel@gmail.com>
Mon, 6 Jan 2025 02:11:25 +0000 (10:11 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 26 Jan 2025 04:22:30 +0000 (20:22 -0800)
commitb2aad24b53333f1904a55d97e3fde2246ef05bb6
tree36f84ba8c6325f8d16a83bcd97517d2aa2b0f774
parent63db8170bf34ce9e0763f87d993cf9b4c9002b09
mm/memmap: prevent double scanning of memmap by kmemleak

kmemleak explicitly scans the mem_map through the valid struct page
objects.  However, memmap_alloc() was also adding this memory to the gray
object list, causing it to be scanned twice.  Remove memmap_alloc() from
the scan list and add a comment to clarify the behavior.

Link: https://lore.kernel.org/lkml/CAOm6qn=FVeTpH54wGDFMHuCOeYtvoTx30ktnv9-w3Nh8RMofEA@mail.gmail.com/
Link: https://lkml.kernel.org/r/20250106021126.1678334-1-guoweikang.kernel@gmail.com
Signed-off-by: Guo Weikang <guoweikang.kernel@gmail.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/memblock.h
mm/mm_init.c
mm/sparse-vmemmap.c