[PATCH] kmemleak: Fix the kmemleak tracking of the percpu areas with!SMP

From: Catalin Marinas
Date: Wed May 09 2012 - 11:45:46 EST


Kmemleak tracks the percpu allocations via a specific API and the
originally allocated areas must be removed from kmemleak (via
kmemleak_free). The code was already doing this for SMP systems.

Reported-by: Sami Liedes <sami.liedes@xxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
---
mm/percpu.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index f47af91..2daf6d5 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1885,6 +1885,8 @@ void __init setup_per_cpu_areas(void)
fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
if (!ai || !fc)
panic("Failed to allocate memory for percpu areas.");
+ /* kmemleak tracks the percpu allocations separately */
+ kmemleak_free(fc);

ai->dyn_size = unit_size;
ai->unit_size = unit_size;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/