aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorGuo Weikang <guoweikang.kernel@gmail.com>2025-01-06 10:11:25 +0800
committerAndrew Morton <akpm@linux-foundation.org>2025-01-25 20:22:30 -0800
commitb2aad24b53333f1904a55d97e3fde2246ef05bb6 (patch)
tree36f84ba8c6325f8d16a83bcd97517d2aa2b0f774 /include/linux/memblock.h
parentmm/fake-numa: allow later numa node hotplug (diff)
downloadwireguard-linux-b2aad24b53333f1904a55d97e3fde2246ef05bb6.tar.xz
wireguard-linux-b2aad24b53333f1904a55d97e3fde2246ef05bb6.zip
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>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 673d5cae7c81..d48b56c1e558 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -378,6 +378,10 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
/* Flags for memblock allocation APIs */
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
#define MEMBLOCK_ALLOC_ACCESSIBLE 0
+/*
+ * MEMBLOCK_ALLOC_NOLEAKTRACE avoids kmemleak tracing. It implies
+ * MEMBLOCK_ALLOC_ACCESSIBLE
+ */
#define MEMBLOCK_ALLOC_NOLEAKTRACE 1
/* We are using top down, so it is safe to use 0 here */