diff mbox series

[v10,2/5] powerpc/crash: introduce a new config option CRASH_HOTPLUG

Message ID 20230423105213.70795-3-sourabhjain@linux.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series PowerPC: In-kernel handling of CPU/Memory hotplug/online/offline events for kdump kernel | expand

Commit Message

Sourabh Jain April 23, 2023, 10:52 a.m. UTC
Due to CPU/Memory hot plug/unplug or online/offline events the system
resources changes. A similar change should reflect in the loaded kdump
kernel kexec segments that describes the state of the CPU and memory of
the running kernel.

If the kdump kernel kexec segments are not updated after the CPU/Memory
hot plug/unplug or online/offline events and kdump kernel tries to
collect the dump with the stale system resource data then this might
lead to dump collection failure or an inaccurate dump collection.

The current method to keep the kdump kernel kexec segments up to date is
by reloading the complete kdump kernel whenever a CPU/Memory hot
plug/unplug or online/offline event is observed in userspace. Reloading
the kdump kernel for every CPU/Memory hot plug/unplug or online/offline
event is inefficient and creates a large window where the kdump service
is not available. It can be improved by doing in-kernel updates to only
necessary kdump kernel kexec segments which describe CPU and Memory
resources of the running kernel to the kdump kernel.

The kernel changes related to in-kernel updates to the kdump kernel
kexec segments are kept under the CRASH_HOTPLUG config option.

Later in the series, a powerpc crash hotplug handler is introduced to
update the kdump kernel kexec segments on CPU/Memory hotplug events.
This arch-specific handler is triggered from a generic crash handler
that registers with the CPU/Memory add/remove notifiers.

The CRASH_HOTPLUG config option is enabled by default.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Laurent Dufour <laurent.dufour@fr.ibm.com>
---
 arch/powerpc/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Laurent Dufour April 24, 2023, 9:57 a.m. UTC | #1
On 23/04/2023 12:52:10, Sourabh Jain wrote:
> Due to CPU/Memory hot plug/unplug or online/offline events the system
> resources changes. A similar change should reflect in the loaded kdump
> kernel kexec segments that describes the state of the CPU and memory of
> the running kernel.
> 
> If the kdump kernel kexec segments are not updated after the CPU/Memory
> hot plug/unplug or online/offline events and kdump kernel tries to
> collect the dump with the stale system resource data then this might
> lead to dump collection failure or an inaccurate dump collection.
> 
> The current method to keep the kdump kernel kexec segments up to date is
> by reloading the complete kdump kernel whenever a CPU/Memory hot
> plug/unplug or online/offline event is observed in userspace. Reloading
> the kdump kernel for every CPU/Memory hot plug/unplug or online/offline
> event is inefficient and creates a large window where the kdump service
> is not available. It can be improved by doing in-kernel updates to only
> necessary kdump kernel kexec segments which describe CPU and Memory
> resources of the running kernel to the kdump kernel.
> 
> The kernel changes related to in-kernel updates to the kdump kernel
> kexec segments are kept under the CRASH_HOTPLUG config option.
> 
> Later in the series, a powerpc crash hotplug handler is introduced to
> update the kdump kernel kexec segments on CPU/Memory hotplug events.
> This arch-specific handler is triggered from a generic crash handler
> that registers with the CPU/Memory add/remove notifiers.
> 
> The CRASH_HOTPLUG config option is enabled by default.
> 
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> Reviewed-by: Laurent Dufour <laurent.dufour@fr.ibm.com>

I can't remember having sent a review-by on that patch earlier.

Anyway, I can't find any issue with that one, so replace with:
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> ---
>  arch/powerpc/Kconfig | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index a6c4407d3ec83..ac0dc0ffe89b4 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -681,6 +681,18 @@ config CRASH_DUMP
>  	  The same kernel binary can be used as production kernel and dump
>  	  capture kernel.
>  
> +config CRASH_HOTPLUG
> +	bool "In-kernel update to kdump kernel on system configuration changes"
> +	default y
> +	depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG)
> +	help
> +	  Quick and efficient mechanism to update the kdump kernel in the
> +	  event of CPU/Memory hot plug/unplug or online/offline events. This
> +	  approach does the in-kernel update to only necessary kexec segment
> +	  instead of unload-reload entire kdump kernel from userspace.
> +
> +	  If unsure, say Y.
> +
>  config FA_DUMP
>  	bool "Firmware-assisted dump"
>  	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
Sourabh Jain April 24, 2023, 3 p.m. UTC | #2
On 24/04/23 15:27, Laurent Dufour wrote:
> On 23/04/2023 12:52:10, Sourabh Jain wrote:
>> Due to CPU/Memory hot plug/unplug or online/offline events the system
>> resources changes. A similar change should reflect in the loaded kdump
>> kernel kexec segments that describes the state of the CPU and memory of
>> the running kernel.
>>
>> If the kdump kernel kexec segments are not updated after the CPU/Memory
>> hot plug/unplug or online/offline events and kdump kernel tries to
>> collect the dump with the stale system resource data then this might
>> lead to dump collection failure or an inaccurate dump collection.
>>
>> The current method to keep the kdump kernel kexec segments up to date is
>> by reloading the complete kdump kernel whenever a CPU/Memory hot
>> plug/unplug or online/offline event is observed in userspace. Reloading
>> the kdump kernel for every CPU/Memory hot plug/unplug or online/offline
>> event is inefficient and creates a large window where the kdump service
>> is not available. It can be improved by doing in-kernel updates to only
>> necessary kdump kernel kexec segments which describe CPU and Memory
>> resources of the running kernel to the kdump kernel.
>>
>> The kernel changes related to in-kernel updates to the kdump kernel
>> kexec segments are kept under the CRASH_HOTPLUG config option.
>>
>> Later in the series, a powerpc crash hotplug handler is introduced to
>> update the kdump kernel kexec segments on CPU/Memory hotplug events.
>> This arch-specific handler is triggered from a generic crash handler
>> that registers with the CPU/Memory add/remove notifiers.
>>
>> The CRASH_HOTPLUG config option is enabled by default.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> Reviewed-by: Laurent Dufour <laurent.dufour@fr.ibm.com>
> I can't remember having sent a review-by on that patch earlier.
>
> Anyway, I can't find any issue with that one, so replace with:
> Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

I apologies for mistakenly applying the "Reviewed-by" tag to the entire
patch series, when it was intended for only one patch. I will remove the
tag in next version.

- Sourabh Jain
diff mbox series

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a6c4407d3ec83..ac0dc0ffe89b4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -681,6 +681,18 @@  config CRASH_DUMP
 	  The same kernel binary can be used as production kernel and dump
 	  capture kernel.
 
+config CRASH_HOTPLUG
+	bool "In-kernel update to kdump kernel on system configuration changes"
+	default y
+	depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG)
+	help
+	  Quick and efficient mechanism to update the kdump kernel in the
+	  event of CPU/Memory hot plug/unplug or online/offline events. This
+	  approach does the in-kernel update to only necessary kexec segment
+	  instead of unload-reload entire kdump kernel from userspace.
+
+	  If unsure, say Y.
+
 config FA_DUMP
 	bool "Firmware-assisted dump"
 	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)