From: Chen Wandun <chenwandun1@gmail.com>
To: kexec@lists.infradead.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev,
linux-riscv@lists.infradead.org, devicetree@vger.kernel.org
Cc: akpm@linux-foundation.org, bhe@redhat.com, rppt@kernel.org,
pasha.tatashin@soleen.com, pratyush@kernel.org,
ruirui.yang@linux.dev, corbet@lwn.net, skhan@linuxfoundation.org,
catalin.marinas@arm.com, will@kernel.org, chenhuacai@kernel.org,
kernel@xen0n.name, pjw@kernel.org, palmer@dabbelt.com,
aou@eecs.berkeley.edu, robh@kernel.org, saravanak@kernel.org,
chenwandun@lixiang.com, zhaomeijing@lixiang.com,
everyzhao@126.com
Subject: [PATCH 00/11] kdump: reduce vmcore size and capture time via linux,no-dump
Date: Wed, 29 Apr 2026 14:58:20 +0800 [thread overview]
Message-ID: <20260429065831.1510858-1-chenwandun@lixiang.com> (raw)
This series has two parts:
- Patches 1-4 are OF reserved_mem bug fixes and small hardening
changes. They stand on their own and at the same time prepare the
ground for the feature work that follows (accurate region counts,
consistent two-pass save/reserve state, and an early-out when the
array is empty).
- Patches 5-11 introduce a new 'linux,no-dump' reserved-memory
device tree property and the kdump plumbing to honour it, split
further as:
* Patches 5-7: core OF changes - parse 'linux,no-dump' on
/reserved-memory/ children, save /memreserve/ firmware regions
into reserved_mem[] with no_dump defaulted on, and add generic
no-dump crash_mem exclusion helpers.
* Patches 8-10: arch kdump consumers - arm64, riscv and
loongarch each call the helpers from patch 7 in their
prepare_elf_headers() so that 'linux,no-dump' /reserved-memory/
children and /memreserve/ regions are filtered out of the
vmcore ELF PT_LOAD segments.
* Patch 11: user-facing documentation in
Documentation/admin-guide/kdump/kdump.rst.
Motivation
==========
On SoCs that carve out large firmware-owned reserved memory (GPU
firmware, DSP, modem, camera ISP, NPU, ...), kdump currently dumps
those carveouts as part of system RAM even though their contents are
firmware state that is not useful for kernel crash analysis. On a
machine with several hundred MiB of such carveouts, the overhead per
vmcore is substantial.
This series adds a declarative way for DT authors to mark such
regions:
reserved-memory {
npu_fw@a0000000 {
reg = <0x0 0xa0000000 0x0 0x10000000>;
linux,no-dump;
};
};
and also defaults /memreserve/ firmware regions (Trusted Firmware /
BL31 images, secondary-CPU spin-table pens, bootloader scratch per
Documentation/arch/arm64/booting.rst and upstream DTS files) to
no_dump=true.
Interaction with existing reserved-memory flags is kept simple:
'linux,no-dump' is an OS hint, it is redundant (but harmless) when
combined with 'no-map' and silently ignored on 'reusable' (CMA)
regions whose contents are relevant for crash analysis. The 'linux,'
prefix follows existing precedents like 'linux,cma-default' since
kdump is a Linux-specific concept.
Benefits
========
- Smaller vmcore. The excluded firmware carveouts are omitted from
the ELF PT_LOAD segments entirely, so the resulting dump file is
smaller by roughly the sum of the tagged regions - on SoCs with
hundreds of MiB of GPU/DSP/modem/NPU carveouts this is a
substantial saving, both on disk and in transit to a dump server.
- Faster kdump. The dump-capture kernel writes less data to storage
or over the network, which directly shortens the crash-to-dump
turnaround. Tools that walk the dump (makedumpfile, crash) also
spend less time on regions that were never going to be useful
anyway.
- No existing behaviour change for DTs that do not opt in: regions
without 'linux,no-dump' and systems without /memreserve/ entries
are dumped exactly as before.
DT binding
==========
The 'linux,no-dump' property is maintained in dt-schema
(reserved-memory.yaml moved there from the kernel tree).
Corresponding PR:
https://github.com/devicetree-org/dt-schema/pull/193
Follow-ups
==========
- powerpc also uses kexec_file and /reserved-memory/, but its
arch/powerpc/kexec/ranges.c uses the _guarded variant of
crash_exclude_mem_range with dynamic realloc and collects
additional RTAS/OPAL firmware ranges. Adapting it needs a small
extra helper; left as a follow-up.
---
Chen Wandun (11):
of: reserved_mem: fix region count for nodes with multiple reg entries
of: reserved_mem: reject reserved memory outside physical address
range
of: reserved_mem: avoid unconditional save of reg entries in
fdt_scan_reserved_mem_late()
of: reserved_mem: skip reserved_mem array allocation when there is
nothing to save
of: reserved_mem: add linux,no-dump property support for reserved
memory regions
of: reserved_mem: save /memreserve/ entries into reserved_mem array
of: reserved_mem: add no-dump crash_mem exclusion helpers
arm64: kdump: exclude no-dump reserved memory regions from vmcore
riscv: kdump: exclude no-dump reserved memory regions from vmcore
loongarch: kdump: exclude no-dump reserved memory regions from vmcore
Documentation: admin-guide: kdump: document linux,no-dump DT property
Documentation/admin-guide/kdump/kdump.rst | 59 ++++++
arch/arm64/kernel/machine_kexec_file.c | 6 +
arch/loongarch/kernel/machine_kexec_file.c | 6 +
arch/riscv/kernel/machine_kexec_file.c | 4 +
drivers/of/of_reserved_mem.c | 233 ++++++++++++++++++---
include/linux/of_reserved_mem.h | 16 ++
6 files changed, 295 insertions(+), 29 deletions(-)
--
2.43.0
next reply other threads:[~2026-04-29 6:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 6:58 Chen Wandun [this message]
2026-04-29 6:58 ` [PATCH 01/11] of: reserved_mem: fix region count for nodes with multiple reg entries Chen Wandun
2026-04-29 6:58 ` [PATCH 02/11] of: reserved_mem: reject reserved memory outside physical address range Chen Wandun
2026-04-29 6:58 ` [PATCH 03/11] of: reserved_mem: avoid unconditional save of reg entries in fdt_scan_reserved_mem_late() Chen Wandun
2026-04-29 6:58 ` [PATCH 04/11] of: reserved_mem: skip reserved_mem array allocation when there is nothing to save Chen Wandun
2026-04-29 6:58 ` [PATCH 05/11] of: reserved_mem: add linux,no-dump property support for reserved memory regions Chen Wandun
2026-04-29 6:58 ` [PATCH 06/11] of: reserved_mem: save /memreserve/ entries into reserved_mem array Chen Wandun
2026-04-29 6:58 ` [PATCH 07/11] of: reserved_mem: add no-dump crash_mem exclusion helpers Chen Wandun
2026-04-29 6:58 ` [PATCH 08/11] arm64: kdump: exclude no-dump reserved memory regions from vmcore Chen Wandun
2026-04-29 6:58 ` [PATCH 09/11] riscv: " Chen Wandun
2026-04-29 6:58 ` [PATCH 10/11] loongarch: " Chen Wandun
2026-04-29 6:58 ` [PATCH 11/11] Documentation: admin-guide: kdump: document linux,no-dump DT property Chen Wandun
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=20260429065831.1510858-1-chenwandun@lixiang.com \
--to=chenwandun1@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aou@eecs.berkeley.edu \
--cc=bhe@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=chenwandun@lixiang.com \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=everyzhao@126.com \
--cc=kernel@xen0n.name \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=pasha.tatashin@soleen.com \
--cc=pjw@kernel.org \
--cc=pratyush@kernel.org \
--cc=robh@kernel.org \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=saravanak@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=will@kernel.org \
--cc=zhaomeijing@lixiang.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