From: Catalin Marinas <catalin.marinas@arm.com>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Nathan Chancellor <nathan@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Zhaoyang Huang <huangzhaoyang@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
ke.wang@unisoc.com,
Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Subject: Re: [PATCHv3] mm: use stack_depot_early_init for kmemleak
Date: Wed, 18 Jan 2023 14:34:30 +0000 [thread overview]
Message-ID: <Y8gDdnpvkCKvVV1t@arm.com> (raw)
In-Reply-To: <1674007655-23016-1-git-send-email-zhaoyang.huang@unisoc.com>
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
prev parent reply other threads:[~2023-01-18 14:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 2:07 zhaoyang.huang
2023-01-18 14:34 ` Catalin Marinas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y8gDdnpvkCKvVV1t@arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=huangzhaoyang@gmail.com \
--cc=ke.wang@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mirsad.todorovac@alu.unizg.hr \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=vbabka@suse.cz \
--cc=zhaoyang.huang@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox