[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y8gDdnpvkCKvVV1t@arm.com>
Date: Wed, 18 Jan 2023 14:34:30 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Nathan Chancellor <nathan@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Zhaoyang Huang <huangzhaoyang@...il.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, ke.wang@...soc.com,
Mirsad Todorovac <mirsad.todorovac@....unizg.hr>
Subject: Re: [PATCHv3] mm: use stack_depot_early_init for kmemleak
On Wed, Jan 18, 2023 at 10:07:35AM +0800, zhaoyang.huang wrote:
> Mirsad report bellow error which caused by stack_depot_init failed in kvcalloc.
> Solve this by having stackdepot use stack_depot_early_init.
[...]
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index 762b91f..ddc1ddf 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -2070,8 +2070,10 @@ static int __init kmemleak_boot_config(char *str)
> return -EINVAL;
> if (strcmp(str, "off") == 0)
> kmemleak_disable();
> - else if (strcmp(str, "on") == 0)
> + else if (strcmp(str, "on") == 0) {
> kmemleak_skip_disable = 1;
> + stack_depot_want_early_init();
> + }
Does this fix still work if kmemleak is default on and no option passed
on the kernel command line? I thought we also need something like:
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 881c3f84e88a..80c69d026890 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -754,6 +754,7 @@ config DEBUG_KMEMLEAK
select KALLSYMS
select CRC32
select STACKDEPOT
+ select STACKDEPOT_ALWAYS_INIT if !DEBUG_KMEMLEAK_DEFAULT_OFF
help
Say Y here if you want to enable the memory leak
detector. The memory allocation/freeing is traced in a way
--
Catalin
Powered by blists - more mailing lists