From: Mikhail Zaslonko <zaslonko@linux.ibm.com>
To: Usama Arif <usama.arif@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
baoquan.he@linux.dev, rppt@kernel.org, pasha.tatashin@soleen.com,
pratyush@kernel.org, ruirui.yang@linux.dev, jbohac@suse.cz,
david@kernel.org, hbathini@linux.ibm.com, leitao@debian.org,
kexec@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kas@kernel.org, hannes@cmpxchg.org,
riel@surriel.com, shakeel.butt@linux.dev, kernel-team@meta.com
Cc: Vasily Gorbik <gor@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
linux-s390@vger.kernel.org, Bradley Morgan <brads@mainlining.org>
Subject: Re: [PATCH] crash: keep crashkernel CMA pages reserved if activation fails
Date: Fri, 6 Nov 2026 12:21:12 +0100 [thread overview]
Message-ID: <0a3c64d1-2b8f-4e0b-87ca-5397d1aaa3ee@linux.ibm.com> (raw)
In-Reply-To: <20261104145600.3708886-1-usama.arif@linux.dev>
On 04-Nov-26 15:56, Usama Arif wrote:
> reserve_crashkernel_cma() adds each crashkernel CMA area to
> crashk_cma_ranges[] as soon as it is declared. If the area later fails
> activation, e.g. because movablecore= put the ZONE_MOVABLE boundary
> inside it, cma_activate_area() releases the pages to the buddy allocator
> as ordinary memory. The range is still handed to the crash kernel and
> excluded from the vmcore, so kernel data that lands there is overwritten
> by the crash kernel and missing from the dump.
>
> Mark the areas with cma_reserve_pages_on_error(), so that a failed
> activation leaves the pages reserved: lost to the first kernel, but safe
> for the crash kernel to use.
>
> Fixes: ab475510e042 ("kdump: implement reserve_crashkernel_cma")
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
> ---
s390 hits this without movablecore= (adding the s390 maintainers and
linux-s390) since ZONE_DMA ends at 2G here.
CMA tries to reserve areas above 4G first, but falls back to lower
memory when it doesn't fit, so a cma area can end up across the 2G boundary.
I ran into this while adding crashkernel=,cma support for s390, which I
will post soon, and came up with the same fix.
About dropping the range instead, as you offered for v2: I'd keep this
version. With the range dropped, the kdump kernel gets less memory than
configured, and that only shows at crash time. With this patch, the
the first kernel 'loses' the memory as with a regular crashkernel= reservation
of the same size.
There is a second problem in the same loop: all areas are named
"crashkernel", which breaks the CMA sysfs and debugfs entries when
there are several. I've sent a separate fix for that:
https://lore.kernel.org/r/20261106104309.3669583-1-zaslonko@linux.ibm.com
Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Tested-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
next prev parent reply other threads:[~2026-11-06 11:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 14:56 Usama Arif
2026-11-04 19:16 ` Bradley Morgan
2026-11-04 21:52 ` [PATCH] crash: keep crashkernel C MA " Usama Arif
2026-11-04 23:42 ` Bradley Morgan
2026-11-06 11:21 ` Mikhail Zaslonko [this message]
2026-11-06 14:05 ` [PATCH] crash: keep crashkernel CMA " Usama Arif
2026-11-06 14:16 ` Bradley Morgan
2026-11-06 15:34 ` Breno Leitao
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=0a3c64d1-2b8f-4e0b-87ca-5397d1aaa3ee@linux.ibm.com \
--to=zaslonko@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=brads@mainlining.org \
--cc=david@kernel.org \
--cc=gor@linux.ibm.com \
--cc=hannes@cmpxchg.org \
--cc=hbathini@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jbohac@suse.cz \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=kexec@lists.infradead.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=riel@surriel.com \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=usama.arif@linux.dev \
/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
all inboxes | Powered by JetHome®