[PATCH v5 3/8] of: reserved_mem: mark /reserved-memory entries with MEMBLOCK_NODUMP

From: Wandun Chen

Date: Thu Aug 06 2026 - 05:44:46 EST


From: Wandun Chen <chenwandun@xxxxxxxxxxx>

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@xxxxxxxxxxx>
Tested-by: Meijing Zhao <zhaomeijing@xxxxxxxxxxx>
---
drivers/of/of_reserved_mem.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 7b1616b9c6c2..f38d11df6f15 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -674,6 +674,9 @@ static void __init fdt_init_reserved_mem_node(unsigned long node, const char *un
rmem->name ? rmem->name : "unknown");
}

+ if (IS_ENABLED(CONFIG_CRASH_DUMP) && !rmem->dumpable)
+ memblock_mark_nodump(rmem->base, rmem->size);
+
reserved_mem_count++;
}

--
2.43.0