Skip to content

[PW_SID:1155899] kdump: reduce vmcore size and capture time - #2574

Open
linux-riscv-bot wants to merge 11 commits into
workflow__riscv__fixesfrom
pw1155899
Open

[PW_SID:1155899] kdump: reduce vmcore size and capture time#2574
linux-riscv-bot wants to merge 11 commits into
workflow__riscv__fixesfrom
pw1155899

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1155899 applied to workflow__riscv__fixes

Name: kdump: reduce vmcore size and capture time
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1155899
Version: 6

Linux RISC-V bot and others added 11 commits September 2, 2026 05:24
Commit 7d163a7 ("memblock: make HugeTLB bootmem allocation work
with KHO") added MEMBLOCK_RSRV_HUGETLB but did not add the corresponding
entry to flagname[]. As a result, memblock debugfs cannot report the
flag by name.

Add the missing RSV_HUGETLB entry.

Fixes: 7d163a7 ("memblock: make HugeTLB bootmem allocation work with KHO")
Signed-off-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Link: https://lore.kernel.org/lkml/20260821020910.3428585-2-zhaomeijing100@gmail.com/
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Replace walk_system_ram_res() with for_each_mem_range(). A later patch
introduces MEMBLOCK_NODUMP in memblock, the reserved-memory regions
marked with MEMBLOCK_NODUMP can be excluded from the vmcore by walking
memblock.

for_each_mem_range() iterates memblock.memory, which is freed after
init unless ARCH_KEEP_MEMBLOCK is selected. riscv needs ARCH_KEEP_MEMBLOCK
to filter reserved memory from the vmcore, so extend its condition
(ACPI || KEXEC) with CRASH_DUMP. arm64 and loongarch already select
ARCH_KEEP_MEMBLOCK unconditionally.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
arm64, loongarch and riscv open-code the same memblock walk in
arch_get_system_nr_ranges() and arch_crash_populate_cmem(). Move it into
the __weak defaults in kernel/crash_core.c and delete the arch copies.

No functional change.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
crash_prepare_headers() counts memory ranges before populating the
allocated crash_mem array. The weak implementation used by ARM64,
RISC-V and LoongArch walks memblock.memory, while x86 performs the same
two-pass operation over system RAM resources. Concurrent memory hotplug
can change range source between the two walks and make the populate
pass overflow cmem->ranges.

Take device_hotplug_lock when preparing crash headers during
kexec_file_load(). The x86 memory hotplug path already takes
device_hotplug_lock, so call __crash_prepare_headers() directly
to avoid recursive locking.

Sashiko reported this issue in [1].

Fixes: 3751e72 ("arm64: kexec_file: add crash dump support")
Fixes: 1bcca86 ("LoongArch: Add crash dump support for kexec_file")
Fixes: 8acea45 ("RISC-V: Support for kexec_file on panic")
Fixes: dd5f726 ("kexec: support for kexec on panic using new system call")
Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Link: https://sashiko.dev/#/message/20260806101002.1F84E1F000E9@smtp.kernel.org [1]
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
for_each_mem_range() skips MEMBLOCK_NOMAP regions implicitly. Switch the
weak defaults to for_each_mem_region(), which exposes struct
memblock_region and per-region flags, and filter NOMAP regions explicitly
via the new crash_should_skip_region() helper. This prepares for a
subsequent patch to extend the skip filter.

No functional change.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add MEMBLOCK_NODUMP to mark regions that should be excluded from
kdump vmcores.

The flag is meant for reserved memory that carries no data useful for
crash analysis. Reusable reserved regions such as CMA may hold useful
data, so these regions must not be marked MEMBLOCK_NODUMP. Subsequent
patches wire this up for /reserved-memory and /memreserve/ entries.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a 'dumpable' flag to struct reserved_mem to decide whether a
reserved area should be included in the kdump vmcore. Non-dumpable
regions are later marked MEMBLOCK_NODUMP;the filtering itself happens
in memblock, keeping the arch kdump code independent of the DT API.

Most reserved regions are owned by devices and do not contain data
useful for kernel crash analysis, so dumpable default to false.
Reusable CMA regions are different: their pages are handed back to the
buddy allocator and may contain key data for crash analysis, so set
dumpable to true in rmem_cma_setup().

The dumpable flag is also used to check /memreserve/ entries for overlap
with other dumpable regions.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Mark non-dumpable reserved-memory regions with MEMBLOCK_NODUMP so
kdump can omit them from the vmcore.

The marking is guarded by CONFIG_CRASH_DUMP so non-kdump kernels do not
pay the cost of splitting memblock.memory entries at NODUMP boundaries.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The /memreserve/ entries are memory reservations made by the bootloader
or firmware, their contents are not needed for kernel crash analysis,
so mark them MEMBLOCK_NODUMP to have kdump omit them from the vmcore.

Entries that overlap a dumpable region (such as CMA) are left unmarked,
because the pages of a dumpable region may carry crash-relevant data.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Reserve regions (for GPU, DSP, ...) carry no data useful for crash
analysis. Exclude MEMBLOCK_NODUMP regions from the vmcore ELF header to
reduce vmcore size and capture time. crash_should_skip_region() now also
returns true for MEMBLOCK_NODUMP.

Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 142.31 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1513.17 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1800.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.41 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.16 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 91.28 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
kdoc
Desc: Detects for kdoc errors
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,01/10] mm: memblock: add missing HugeTLB flag name"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1551.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1850.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.37 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.94 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,02/10] riscv: build crash_mem ranges from memblock instead of resource tree"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.80 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
kdoc
Desc: Detects for kdoc errors
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v6,08/10] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.40 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1468.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1800.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.37 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.14 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
kdoc
Desc: Detects for kdoc errors
Duration: 0.83 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 9: "[v6,09/10] of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 150.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1476.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1792.81 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.04 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 90.53 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
kdoc
Desc: Detects for kdoc errors
Duration: 5.49 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 10: "[v6,10/10] crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant