Skip to content

Commit 571cc1d

Browse files
committed
powerpc/dart: Drop unnecessary call to kmemleak_no_scan()
Erhard reported that kmemleak was showing a warning at boot: kmemleak: Not scanning unknown object at 0xc00000007f000000 CPU: 0 PID: 0 Comm: swapper Not tainted 5.19.0-rc3-PMacG5+ #2 Call Trace: .dump_stack_lvl+0x7c/0xc4 (unreliable) .kmemleak_no_scan+0xe0/0x100 .iommu_init_early_dart+0x2f0/0x924 .pmac_probe+0x1b0/0x20c .setup_arch+0x1b8/0x674 .start_kernel+0xdc/0xb74 start_here_common+0x1c/0x44 DART table allocated at: (____ptrval____) Which he bisected to a change in kmemleak, commit 23c2d49 ("mm: kmemleak: take a full lowmem check in kmemleak_*_phys()"). Because pmac_probe() is called before mem_topology_setup(), the min/ max PFN variables are still zero. That causes kmemleak_alloc_phys() to ignore the allocation, because the checks against the PFN fail. Then kmemleak_no_scan() can't find the allocation and prints warning. Given that kmemleak_alloc_phys() is ignoring the allocation to begin with, there's no need to call kmemleak_no_scan() at all, which avoids the warning. Reported-by: Erhard Furtner <[email protected]> Closes: https://lore.kernel.org/all/[email protected]%2F/ Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent a88e266 commit 571cc1d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/powerpc/sysdev/dart_iommu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/suspend.h>
2525
#include <linux/memblock.h>
2626
#include <linux/gfp.h>
27-
#include <linux/kmemleak.h>
2827
#include <linux/of_address.h>
2928
#include <asm/io.h>
3029
#include <asm/iommu.h>
@@ -243,9 +242,6 @@ static void __init allocate_dart(void)
243242
if (!dart_tablebase)
244243
panic("Failed to allocate 16MB below 2GB for DART table\n");
245244

246-
/* There is no point scanning the DART space for leaks*/
247-
kmemleak_no_scan((void *)dart_tablebase);
248-
249245
/* Allocate a spare page to map all invalid DART pages. We need to do
250246
* that to work around what looks like a problem with the HT bridge
251247
* prefetching into invalid pages and corrupting data

0 commit comments

Comments
 (0)