[PW_SID:1118744] kdump: reduce vmcore size and capture time#2171
[PW_SID:1118744] kdump: reduce vmcore size and capture time#2171linux-riscv-bot wants to merge 11 commits into
Conversation
…_DUMP=n Prepare for an upcoming change that excludes non-dumpable reserved regions from the kdump vmcore and will call crash_exclude_mem_range() from generic, non-arch code. No functional change. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
In both fdt_scan_reserved_mem and fdt_scan_reserved_mem_late, there are identical check-related print messages. Consolidate these messages by moving them all into the fdt_scan_reserved_mem function. No functional change. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
When total_reserved_mem_cnt is 0, there is no /reserved-memory node so fdt_scan_reserved_mem_late() have nothing to do, so return -ENODEV directly from alloc_reserved_mem_array() in this case. No functional change. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…rved_mem_late() Prepare for storing /memreserve/ entries in the reserved_mem array. alloc_reserved_mem_array was skipped if the device tree lacks a /reserved-memory node, pointer 'reserved_mem' continues to reference the reserved_mem_array which lives in __initdata, storing /memreserve/ entries into reserved_mem_array would result in metadata loss, and an out-of-bounds memory access will occur if the device tree contains more than MAX_RESERVED_REGIONS /memreserve/ entries. So split alloc_reserved_mem_array() from fdt_scan_reserved_mem_late(), and call alloc_reserved_mem_array() whether or not there is a /reserved-memory node. No functional change. The actual /memreserve/ population is added in a follow-up patch. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a 'dumpable' flag to struct reserved_mem so the kernel can decide whether a reserved area should be included in the kdump vmcore. Most reserved regions are owned by devices and do not contain data useful for kernel crash analysis, so excluding them by default is the right behaviour. Reusable CMA regions are different: pages in a CMA region are handed back to the buddy allocator and may contain key data for crash analysis, so set dumpable to true in rmem_cma_setup(). 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> Link: https://lore.kernel.org/all/20260506144542.GA2072596-robh@kernel.org/ Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
/memreserve/ is used by firmware or bootloaders, such regions hold no useful data for crash analysis, they should be excluded from the kdump vmcore, so save /memreserve/ entries into the reserved_mem array for later exclusion. If a /memreserve/ entry overlaps any dumpable reserved region, mark the whole memreserve entry dumpable as well. This may keep slightly more memory in vmcore than strictly necessary, but avoids splitting entries and never drops data that may be useful for crash analysis. 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 two helpers to exclude non-dumpable regions for arch-specific code. - of_reserved_mem_kdump_nr_ranges() returns the count of regions that are not dumpable. Each excluded region may split an existing crash_mem range into two, so callers use this to calculate crash_mem allocation size. - of_reserved_mem_kdump_exclude() walks reserved_mem[] and calls crash_exclude_mem_range() for every non-dumpable region. 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>
Reserved memory regions are excluded from vmcore by default unless marked dumpable. Honor the dumpable flag to filter out device firmware regions (e.g., GPU, DSP, modem) reserved via device tree, since they typically contain data not useful for kernel crash analysis and can significantly increase vmcore size. Use of_reserved_mem_kdump_exclude() to perform the exclusion, and pre-size the crash_mem array via of_reserved_mem_kdump_nr_ranges(). Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Tested-by: Meijing Zhao <zhaomeijing@lixiang.com> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Apply the same non-dumpable reserved memory filtering to RISC-V kdump as was done for arm64. Use of_reserved_mem_kdump_exclude() to drop flagged regions from the elfcorehdr PT_LOAD segments, and of_reserved_mem_kdump_nr_ranges() to pre-size the crash_mem array. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…mcore Apply the same non-dumpable reserved memory filtering to LoongArch kdump as was done for arm64. Use of_reserved_mem_kdump_exclude() to drop flagged regions from the elfcorehdr PT_LOAD segments, and of_reserved_mem_kdump_nr_ranges() to pre-size the crash_mem array. Signed-off-by: Wandun Chen <chenwandun@lixiang.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 1: "[v4,01/10] kexec/crash: provide crash_exclude_mem_range() stub when CONFIG_CRASH_DUMP=n" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 2: "[v4,02/10] of: reserved_mem: dedup and relocate reserved-memory messages" |
|
Patch 8: "[v4,08/10] arm64: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 8: "[v4,08/10] arm64: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 9: "[v4,09/10] riscv: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
|
Patch 10: "[v4,10/10] loongarch: kdump: exclude non-dumpable reserved memory regions from vmcore" |
89be0ce to
dc5ff20
Compare
PR for series 1118744 applied to workflow__riscv__fixes
Name: kdump: reduce vmcore size and capture time
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1118744
Version: 4