FAILED: patch "[PATCH] kho: do not reserve scratch memory in the kdump kernel" failed to apply to 6.18-stable tree
Subsystems (3)
Sasha Levin
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 48be325089e15077411785d0c41ddb9071a61081
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 48be325089e15077411785d0c41ddb9071a61081 Mon Sep 17 00:00:00 2001
From: Maxi Saparov <[email protected]>
Date: Tue, 11 Aug 2026 12:18:57 -0400
Subject: [PATCH] kho: do not reserve scratch memory in the kdump kernel
If a kernel with CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT=y (or kho=on) does not receive a handover FDT, it reserves KHO scratch memory in kho_reserve_scratch().
The kdump kernel always takes this path. Since commit a6715d7ec472 ("kho: skip KHO for crash kernel"), the kernel does not add KHO metadata to the crash kimage. As a result, the kdump kernel never receives a handover FDT and always reserves scratch memory.
The kdump kernel boots in the small crashkernel= memory reservation. On our x86 hosts, the kernel and initramfs make approximately 176 MB of early reservations. The scratch areas then use approximately 650 MB more of the crashkernel memory. When a large early allocation fails, the kdump kernel panics:
bio: can't create integrity buf pool
A kdump kernel has nothing to hand over: its only task is to dump the memory of the old kernel and reboot. Fix is to disable KHO at the top of kho_memory_init() so that the kdump kernel does not reserve scratch memory.
--- kernel/liveupdate/kexec_handover.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/liveupdate/kexec_handover.c +7 -0
@@ -12,6 +12,7 @@#include <linux/cleanup.h> #include <linux/cma.h> +#include <linux/crash_dump.h> #include <linux/kmemleak.h> #include <linux/count_zeros.h> #include <linux/kasan.h>
@@ -1939,6 +1940,12 @@ void __init kho_memory_init_early(void)void __init kho_memory_init (void ) { +if (is_kdump_kernel ()) { + kho_enable = false; +pr_info ("disabled in the kdump kernel\n" ); +return ; + } +if (kho_in.scratch_phys)kho_mem_retrieve ();else
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 kho: do not reserve scratch memory in the kdump kernel
From: Maxi Saparov <[email protected]>
[ Upstream commit 48be325089e15077411785d0c41ddb9071a61081 ]
If a kernel with CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT=y (or kho=on) does not receive a handover FDT, it reserves KHO scratch memory in kho_reserve_scratch().
The kdump kernel always takes this path. Since commit a6715d7ec472 ("kho: skip KHO for crash kernel"), the kernel does not add KHO metadata to the crash kimage. As a result, the kdump kernel never receives a handover FDT and always reserves scratch memory.
The kdump kernel boots in the small crashkernel= memory reservation. On our x86 hosts, the kernel and initramfs make approximately 176 MB of early reservations. The scratch areas then use approximately 650 MB more of the crashkernel memory. When a large early allocation fails, the kdump kernel panics:
bio: can't create integrity buf pool
A kdump kernel has nothing to hand over: its only task is to dump the memory of the old kernel and reboot. Fix is to disable KHO at the top of kho_memory_init() so that the kdump kernel does not reserve scratch memory.
--- kernel/kexec_handover.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/kexec_handover.c +7 -0
@@ -10,6 +10,7 @@#include <linux/cleanup.h> #include <linux/cma.h> +#include <linux/crash_dump.h> #include <linux/count_zeros.h> #include <linux/kexec.h> #include <linux/kexec_handover.h>
@@ -1325,6 +1326,12 @@ void __init kho_memory_init(void) {struct folio *folio; +if (is_kdump_kernel ()) { + kho_enable = false; +pr_info ("disabled in the kdump kernel\n" ); +return ; + } +if (kho_in.scratch_phys) { kho_scratch =phys_to_virt (kho_in.scratch_phys);kho_release_scratch ();
Signature · 1 line
2.53.0