[PW_SID:1057091] arm64/riscv: Add support for crashkernel CMA reservation#1490
[PW_SID:1057091] arm64/riscv: Add support for crashkernel CMA reservation#1490linux-riscv-bot wants to merge 5 commits intoworkflowfrom
Conversation
During a memory hot-remove event, the elfcorehdr is rebuilt to exclude the removed memory. While updating the crash memory ranges for this operation, the crash memory ranges array can become unsorted. This happens because remove_mem_range() may split a memory range into two parts and append the higher-address part as a separate range at the end of the array. So far, no issues have been observed due to the unsorted crash memory ranges. However, this could lead to problems once crash memory range removal is handled by generic code, as introduced in the upcoming patches in this series. Currently, powerpc uses a platform-specific function, remove_mem_range(), to exclude hot-removed memory from the crash memory ranges. This function performs the same task as the generic crash_exclude_mem_range() in crash_core.c. The generic helper also ensures that the crash memory ranges remain sorted. So remove the redundant powerpc-specific implementation and instead call crash_exclude_mem_range_guarded() (which internally calls crash_exclude_mem_range()) to exclude the hot-removed memory ranges. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Baoquan he <bhe@redhat.com> Cc: Jinjie Ruan <ruanjinjie@huawei.com> Cc: Hari Bathini <hbathini@linux.ibm.com> Cc: Madhavan Srinivasan <maddy@linux.ibm.com> Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Cc: Shivang Upadhyay <shivangu@linux.ibm.com> Cc: linux-kernel@vger.kernel.org Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The crash memory alloc, and the exclude of crashk_res, crashk_low_res and crashk_cma memory are almost identical across different architectures, handling them in the crash core would eliminate a lot of duplication, so do them in the common code. To achieve the above goal, three architecture-specific functions are introduced: - arch_get_system_nr_ranges(). Pre-counts the max number of memory ranges. - arch_crash_populate_cmem(). Collects the memory ranges and fills them into cmem. - arch_crash_exclude_ranges(). Architecture's additional crash memory ranges exclusion, defaulting to empty. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The crash memory exclude of crashk_res and crashk_cma memory on powerpc are almost identical to the generic crash_exclude_core_ranges(). By introducing the architecture-specific arch_crash_exclude_mem_range() function with a default implementation of crash_exclude_mem_range(), and using crash_exclude_mem_range_guarded as powerpc's separate implementation, the generic crash_exclude_core_ranges() helper function can be reused. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Commit 35c18f2 ("Add a new optional ",cma" suffix to the crashkernel= command line option") and commit ab47551 ("kdump: implement reserve_crashkernel_cma") added CMA support for kdump crashkernel reservation. Crash kernel memory reservation wastes production resources if too large, risks kdump failure if too small, and faces allocation difficulties on fragmented systems due to contiguous block constraints. The new CMA-based crashkernel reservation scheme splits the "large fixed reservation" into a "small fixed region + large CMA dynamic region": the CMA memory is available to userspace during normal operation to avoid waste, and is reclaimed for kdump upon crash—saving memory while improving reliability. So extend crashkernel CMA reservation support to arm64. The following changes are made to enable CMA reservation: - Parse and obtain the CMA reservation size along with other crashkernel parameters. - Call reserve_crashkernel_cma() to allocate the CMA region for kdump. - Include the CMA-reserved ranges for kdump kernel to use. - Exclude the CMA-reserved ranges from the crash kernel memory to prevent them from being exported through /proc/vmcore, which is already done in the crash core. Update kernel-parameters.txt to document CMA support for crashkernel on arm64 architecture. Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Commit 35c18f2 ("Add a new optional ",cma" suffix to the crashkernel= command line option") and commit ab47551 ("kdump: implement reserve_crashkernel_cma") added CMA support for kdump crashkernel reservation. This allows the kernel to dynamically allocate contiguous memory for crash dumping when needed, rather than permanently reserving a fixed region at boot time. So extend crashkernel CMA reservation support to riscv. The following changes are made to enable CMA reservation: - Parse and obtain the CMA reservation size along with other crashkernel parameters. - Call reserve_crashkernel_cma() to allocate the CMA region for kdump. - Include the CMA-reserved ranges for kdump kernel to use. - Exclude the CMA-reserved ranges from the crash kernel memory to prevent them from being exported through /proc/vmcore, which is already done in the crash core. Update kernel-parameters.txt to document CMA support for crashkernel on riscv architecture. Acked-by: Paul Walmsley <pjw@kernel.org> # arch/riscv Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 1: "[v6,1/5] powerpc/crash: sort crash memory ranges before preparing elfcorehdr" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 2: "[v6,2/5] crash: Exclude crash kernel memory in crash core" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 3: "[v6,3/5] crash: Use crash_exclude_core_ranges() on powerpc" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 4: "[v6,4/5] arm64: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
|
Patch 5: "[v6,5/5] riscv: kexec: Add support for crashkernel CMA reservation" |
PR for series 1057091 applied to workflow
Name: arm64/riscv: Add support for crashkernel CMA reservation
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1057091
Version: 6