* [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates
@ 2026-02-16 17:14 Vishal Chourasia
2026-02-17 7:22 ` kernel test robot
2026-02-17 8:25 ` kernel test robot
0 siblings, 2 replies; 3+ messages in thread
From: Vishal Chourasia @ 2026-02-16 17:14 UTC (permalink / raw)
To: maddy, sourabhjain, linuxppc-dev, linux-kernel, kexec
Cc: mpe, tglx, mingo, bp, dave.hansen, x86, akpm, bhe, mahesh,
ritesh.list, vishalc, thuth, hbathini, eajames, dwmw, kai.huang,
pbonzini, ubizjak, coxu, fuqiang.wang, brgerst, liaoyuanhong,
jbohac
The arch_crash_handle_hotplug_event() interface currently lacks the CPU
index associated with hotplug events. This forces architecture handlers,
specifically on PowerPC, to unconditionally update the crash Flattened
Device Tree (FDT) for every CPU online event which should only be done
in case of DLPAR operations which add/remove new device tree node under the
/cpus. On large systems with crash kernel loaded, this behavior causes a
significant performance bottleneck. For example, during SMT switch
operations involving 1400 CPUs, the redundant execution of
update_crash_fdt() adds over half an hour of overhead
As shown in the ftrace function graph:
83) bash-14351 | $ 2283891 us | } /* update_cpus_node */
This patch passes the CPU index to the arch-specific handlers and
modifies the PowerPC implementation to check cpus_booted_once_mask. If
a CPU has been previously initialized, its FDT node is already present,
allowing the handler to skip the redundant update_crash_fdt() call.
Fixes: b741092d5976 ("powerpc/crash: add crash CPU hotplug support")
Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
---
arch/powerpc/include/asm/kexec.h | 2 +-
arch/powerpc/kexec/crash.c | 5 +++--
arch/x86/include/asm/kexec.h | 2 +-
arch/x86/kernel/crash.c | 2 +-
include/linux/crash_core.h | 2 +-
kernel/crash_core.c | 2 +-
6 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index bd4a6c42a5f3..2d6d32942bc0 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -137,7 +137,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
}
#ifdef CONFIG_CRASH_HOTPLUG
-void arch_crash_handle_hotplug_event(struct kimage *image, void *arg);
+void arch_crash_handle_hotplug_event(struct kimage *image, int cpu, void *arg);
#define arch_crash_handle_hotplug_event arch_crash_handle_hotplug_event
int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags);
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index a325c1c02f96..d280883c8ab6 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -568,7 +568,7 @@ int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags)
* part of the FDT.
* Memory add/remove: No action is taken as this is not yet supported.
*/
-void arch_crash_handle_hotplug_event(struct kimage *image, void *arg)
+void arch_crash_handle_hotplug_event(struct kimage *image, int cpu, void *arg)
{
struct memory_notify *mn;
@@ -577,7 +577,8 @@ void arch_crash_handle_hotplug_event(struct kimage *image, void *arg)
return;
case KEXEC_CRASH_HP_ADD_CPU:
- update_crash_fdt(image);
+ if (!cpumask_test_cpu(cpu, &cpus_booted_once_mask))
+ update_crash_fdt(image);
break;
case KEXEC_CRASH_HP_REMOVE_MEMORY:
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 5cfb27f26583..57f5c5067267 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -222,7 +222,7 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image);
extern void kdump_nmi_shootdown_cpus(void);
#ifdef CONFIG_CRASH_HOTPLUG
-void arch_crash_handle_hotplug_event(struct kimage *image, void *arg);
+void arch_crash_handle_hotplug_event(struct kimage *image, int cpu, void *arg);
#define arch_crash_handle_hotplug_event arch_crash_handle_hotplug_event
int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags);
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 335fd2ee9766..dda4ad1a163e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -508,7 +508,7 @@ unsigned int arch_crash_get_elfcorehdr_size(void)
*
* Prepare the new elfcorehdr and replace the existing elfcorehdr.
*/
-void arch_crash_handle_hotplug_event(struct kimage *image, void *arg)
+void arch_crash_handle_hotplug_event(struct kimage *image, int cpu, void *arg)
{
void *elfbuf = NULL, *old_elfcorehdr;
unsigned long nr_mem_ranges;
diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index d35726d6a415..118e2e03e0b5 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -42,7 +42,7 @@ static inline int crash_load_dm_crypt_keys(struct kimage *image) {return 0; }
#endif
#ifndef arch_crash_handle_hotplug_event
-static inline void arch_crash_handle_hotplug_event(struct kimage *image, void *arg) { }
+static inline void arch_crash_handle_hotplug_event(struct kimage *image, int cpu, void *arg) { }
#endif
int crash_check_hotplug_support(void);
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index 3952b3e102e0..27c6f57e5169 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -634,7 +634,7 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu,
image->hp_action = hp_action;
/* Now invoke arch-specific update handler */
- arch_crash_handle_hotplug_event(image, arg);
+ arch_crash_handle_hotplug_event(image, cpu, arg);
/* No longer handling a hotplug event */
image->hp_action = KEXEC_CRASH_HP_NONE;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates
2026-02-16 17:14 [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates Vishal Chourasia
@ 2026-02-17 7:22 ` kernel test robot
2026-02-17 8:25 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-02-17 7:22 UTC (permalink / raw)
To: Vishal Chourasia; +Cc: oe-kbuild-all
Hi Vishal,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:
[auto build test WARNING on powerpc/next]
[also build test WARNING on powerpc/fixes tip/x86/core akpm-mm/mm-everything linus/master v6.19 next-20260216]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Vishal-Chourasia/kexec-optimize-crash-hotplug-by-filtering-redundant-FDT-updates/20260217-012054
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
patch link: https://lore.kernel.org/r/20260216171456.527608-2-vishalc%40linux.ibm.com
patch subject: [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260217/202602171501.5ULv2o6N-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260217/202602171501.5ULv2o6N-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602171501.5ULv2o6N-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> Warning: arch/powerpc/kexec/crash.c:571 function parameter 'cpu' not described in 'arch_crash_handle_hotplug_event'
>> Warning: arch/powerpc/kexec/crash.c:571 function parameter 'cpu' not described in 'arch_crash_handle_hotplug_event'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates
2026-02-16 17:14 [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates Vishal Chourasia
2026-02-17 7:22 ` kernel test robot
@ 2026-02-17 8:25 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-02-17 8:25 UTC (permalink / raw)
To: Vishal Chourasia; +Cc: oe-kbuild-all
Hi Vishal,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:
[auto build test WARNING on powerpc/next]
[also build test WARNING on powerpc/fixes tip/x86/core akpm-mm/mm-everything linus/master v6.19 next-20260216]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Vishal-Chourasia/kexec-optimize-crash-hotplug-by-filtering-redundant-FDT-updates/20260217-012054
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
patch link: https://lore.kernel.org/r/20260216171456.527608-2-vishalc%40linux.ibm.com
patch subject: [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20260217/202602171625.BjsqUbLO-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260217/202602171625.BjsqUbLO-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602171625.BjsqUbLO-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> Warning: arch/x86/kernel/crash.c:511 function parameter 'cpu' not described in 'arch_crash_handle_hotplug_event'
>> Warning: arch/x86/kernel/crash.c:511 function parameter 'cpu' not described in 'arch_crash_handle_hotplug_event'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-17 8:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 17:14 [RFC PATCH v1] kexec: optimize crash hotplug by filtering redundant FDT updates Vishal Chourasia
2026-02-17 7:22 ` kernel test robot
2026-02-17 8:25 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.