v5 2026-08-06

kdump 跳过固件保留内存减小 vmcore · v5

为 reserved_mem 增加 dumpable 标志并用 MEMBLOCK_NODUMP 过滤 kdump vmcore,DT 架构跳过固件保留内存。

原始补丁链接

子 Patch(8)

1/8
memblock: introduce MEMBLOCK_NODUMP flag
新增 MEMBLOCK_NODUMP 标志,标记不应进入 kdump vmcore 的保留内存;CMA 等可复用区域不能标记,避免丢失崩溃分析数据。
2/8
of: reserved_mem: add dumpable flag to opt-in vmcore
struct reserved_mem 新增 dumpable 标志,默认为 false 表示不导出;CMA 区域设为 true,以便 kdump 包含其潜在有用数据。
3/8
of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP
在 CONFIG_CRASH_DUMP 下,将 /reserved-memory 中非 dumpable 区域标记 MEMBLOCK_NODUMP,使 kdump 省略这些区域,同时避免非 kdump 内核产生额外开销。
4/8
of: reserved_mem: mark /memreserve/ entries as MEMBLOCK_NODUMP
将 /memreserve/ 条目标记 MEMBLOCK_NODUMP;但与 dumpable 区域重叠的部分保留不标记,避免遗漏 CMA 等区域中可能含有的崩溃关键数据。
5/8
riscv: build crash_mem ranges from memblock instead of resource tree
From: Wandun Chen chenwandun@lixiang.com Replace walk_system_ram_res() with for_each_mem_range(). The MEMBLOCK_NODUMP flag lives in memblock, so only by walking memblock can the reserved-memory reg
6/8
crash_core: fold duplicated memblock arch hooks into the weak default
From: Wandun Chen chenwandun@lixiang.com The weak defaults are only consumed by crash_prepare_headers(), which is called only by arm64, riscv, loongarch (via the weak default) and x86 (via its own
7/8
crash_core: replace for_each_mem_range() with for_each_mem_region()
From: Wandun Chen chenwandun@lixiang.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 pe
8/8
crash_core: skip MEMBLOCK_NODUMP regions when building vmcore ELF header
From: Wandun Chen chenwandun@lixiang.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 siz