Re: [PATCH v3 08/17] crash: Extract crash_get_memory_ranges() helper
From: Mike Rapoport
Date: Tue Sep 01 2026 - 16:18:18 EST
Hi,
> Factor out the crash memory range collection logic from
> crash_prepare_headers() into a separate function. This allows
> the memory hotplug path to obtain and modify the range list
> (e.g. remove offlined memory) before generating the elfcorehdr.
>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Baoquan He <baoquan.he@xxxxxxxxx>
> Cc: Mike Rapoport <rppt@xxxxxxxxxx>
> Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> Cc: Pratyush Yadav <pratyush@xxxxxxxxxx>
> Cc: Dave Young <ruirui.yang@xxxxxxxxx>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
>
> diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
> index bc087124cd78e..619af312bd9a5 100644
> --- a/include/linux/crash_core.h
> +++ b/include/linux/crash_core.h
> @@ -62,6 +62,7 @@ extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_ma
> extern int crash_prepare_headers(int need_kernel_map, void **addr,
> unsigned long *sz, unsigned long *nr_mem_ranges);
> extern int crash_exclude_core_ranges(struct crash_mem **cmem);
> +extern int crash_get_memory_ranges(struct crash_mem **mem_ranges);
No need for extern here as well.
--
Sincerely yours,
Mike.