From: Baoquan He <bhe@redhat.com>
To: Andrey Konovalov <andreyknvl@gmail.com>
Cc: linux-mm@kvack.org, ryabinin.a.a@gmail.com, glider@google.com,
dvyukov@google.com, vincenzo.frascino@arm.com,
akpm@linux-foundation.org, kasan-dev@googlegroups.com,
linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
sj@kernel.org, lorenzo.stoakes@oracle.com, elver@google.com,
snovitoll@gmail.com
Subject: Re: [PATCH v2 00/12] mm/kasan: make kasan=on|off work for all three modes
Date: Sun, 17 Aug 2025 11:40:46 +0800 [thread overview]
Message-ID: <aKFPPi2sti7+3JZ9@MiWiFi-R3L-srv> (raw)
In-Reply-To: <CA+fCnZcdSDEZvRSxEnogBMCFg1f-PK7PKx0KB_1SA0saY6-21g@mail.gmail.com>
On 08/16/25 at 06:50am, Andrey Konovalov wrote:
> On Thu, Aug 14, 2025 at 10:56 AM Baoquan He <bhe@redhat.com> wrote:
> >
> > Ah, I got what you mean. We probably are saying different things.
> >
> > In order to record memory content of a corrupted kernel, we need reserve
> > a memory region during bootup of a normal kernel (usually called 1st
> > kernel) via kernel parameter crashkernel=nMB in advance. Then load
> > kernel into the crashkernel memory region, that means the region is not
> > usable for 1st kernel. When 1st kernel collapsed, we stop the 1st kernel
> > cpu/irq and warmly switch to the loaded kernel in the crashkernel memory
> > region (usually called kdump kernel). In kdump kernel, it boots up and
> > enable necessary features to read out the 1st kernel's memory content,
> > we usually use user space tool like makeudmpfile to filter out unwanted
> > memory content.
> >
> > So this patchset intends to disable KASAN to decrease the crashkernel
> > meomry value because crashkernel is not usable for 1st kernel. As for
> > shadow memory of 1st kernel, we need recognize it and filter it away
> > in makedumpfile.
>
> Ah, I see, thank you for the explanation!
>
> So kdump kernel runs with the amount of RAM specified by crashkernel=.
> And KASAN's shadow memory increases RAM usage, which means
> crashkernel= needs to be set to a higher value for KASAN kernels. Is
> my understanding of the problem correct?
Yeah, you are quite right.
When I tested it, on x86_64 and arm64, usually I set crashkernel=256M
and it's sufficient. However, when KASAN is enabled and generic mode is
taken, I need set crashkernel=768M to make vmcore dumping succeed. In
kdump kernel, read_vmcore() uses ioremap to map the old memory of
collapsed kernel for reading out, those vmalloc-ed areas are lazily
freed and cause more shadow memory than what we usually think shadow
memory only costs 1/8 of physical RAM.
prev parent reply other threads:[~2025-08-17 3:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 12:49 [PATCH v2 00/12] mm/kasan: make kasan=on|off work for all three modes Baoquan He
2025-08-12 12:49 ` [PATCH v2 01/12] mm/kasan: add conditional checks in functions to return directly if kasan is disabled Baoquan He
2025-08-12 12:49 ` [PATCH v2 02/12] mm/kasan: move kasan= code to common place Baoquan He
2025-08-12 12:49 ` [PATCH v2 03/12] mm/kasan/sw_tags: don't initialize kasan if it's disabled Baoquan He
2025-08-12 12:49 ` [PATCH v2 04/12] arch/arm: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 05/12] arch/arm64: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 06/12] arch/loongarch: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 07/12] arch/powerpc: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 08/12] arch/riscv: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 09/12] arch/x86: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 10/12] arch/xtensa: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 11/12] arch/um: " Baoquan He
2025-08-12 12:49 ` [PATCH v2 12/12] mm/kasan: make kasan=on|off take effect for all three modes Baoquan He
2025-08-12 13:39 ` [PATCH v2 00/12] mm/kasan: make kasan=on|off work " Baoquan He
2025-08-12 15:10 ` Baoquan He
2025-08-12 16:57 ` Andrey Konovalov
2025-08-12 17:14 ` Andrey Konovalov
2025-08-13 11:14 ` Baoquan He
2025-08-14 5:23 ` Andrey Konovalov
2025-08-14 8:56 ` Baoquan He
2025-08-16 4:50 ` Andrey Konovalov
2025-08-17 3:40 ` Baoquan He [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=aKFPPi2sti7+3JZ9@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=ryabinin.a.a@gmail.com \
--cc=sj@kernel.org \
--cc=snovitoll@gmail.com \
--cc=vincenzo.frascino@arm.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;
as well as URLs for NNTP newsgroup(s).