[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220705113158.127600-1-patrick.wang.shcn@gmail.com>
Date: Tue, 5 Jul 2022 19:31:58 +0800
From: Patrick Wang <patrick.wang.shcn@...il.com>
To: dennis@...nel.org, tj@...nel.org, cl@...ux.com,
akpm@...ux-foundation.org
Cc: catalin.marinas@....com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, patrick.wang.shcn@...il.com
Subject: [PATCH] mm: percpu: use kmemleak_ignore_phys() instead of kmemleak_free()
Kmemleak recently added a rbtree to store the objects
allocted with physical address. Those objects can't be
freed with kmemleak_free(). Use kmemleak_ignore_phys()
instead of kmemleak_free() for those objects.
Signed-off-by: Patrick Wang <patrick.wang.shcn@...il.com>
---
Similar to:
https://lkml.kernel.org/r/20220628113714.7792-2-yee.lee@mediatek.com
mm/percpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 3633eeefaa0d..27697b2429c2 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -3104,7 +3104,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
goto out_free_areas;
}
/* kmemleak tracks the percpu allocations separately */
- kmemleak_free(ptr);
+ kmemleak_ignore_phys(__pa(ptr));
areas[group] = ptr;
base = min(ptr, base);
@@ -3304,7 +3304,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size, pcpu_fc_cpu_to_node_fn_t
goto enomem;
}
/* kmemleak tracks the percpu allocations separately */
- kmemleak_free(ptr);
+ kmemleak_ignore_phys(__pa(ptr));
pages[j++] = virt_to_page(ptr);
}
}
@@ -3417,7 +3417,7 @@ void __init setup_per_cpu_areas(void)
if (!ai || !fc)
panic("Failed to allocate memory for percpu areas.");
/* kmemleak tracks the percpu allocations separately */
- kmemleak_free(fc);
+ kmemleak_ignore_phys(__pa(fc));
ai->dyn_size = unit_size;
ai->unit_size = unit_size;
--
2.25.1
Powered by blists - more mailing lists