diff mbox series

[v9,2/6] powerpc/crash: introduce a new config option CRASH_HOTPLUG

Message ID 20230312181154.278900-3-sourabhjain@linux.ibm.com (mailing list archive)
State Superseded
Headers show
Series PowerPC: in kernel handling of CPU hotplug events for crash kernel | expand

Commit Message

Sourabh Jain March 12, 2023, 6:11 p.m. UTC
Due to CPU/Memory hotplug events the system resources changes. A similar
change should reflect in the loaded kdump kernel image that describes
the state of the CPU and memory of the running kernel.

If the kdump kernel image is not updated after the CPU or Memory hotplug
events and it tries to collect the dump with the stale system resource
data this might lead to dump collection failure or an inaccurate dump
collection.

The current method to keep the kdump kernel up to date is by triggering
reload (i.e unload and load) the entire kdump kernel image whenever a
CPU or Memory hotplug event is observed by udev in the userspace.
Reloading the complete kdump kernel image is an expensive task. It can
be easily avoided by doing the in-kernel updates to specific kdump
kernel image components which are responsible for describing CPU and
Memory resources of the running kernel to the kdump kernel.

The kernel changes related to in-kernel update to the kdump kernel image
on CPU/Memory hotplug events are kept under the CRASH_HOTPLUG config
option.

Later in the series, a powerpc crash hotplug handler is introduced to
update the kdump kernel image on CPU/Memory hotplug events. This arch
specific handler is trigger from a generic crash handler that registers
with the CPU and memory notifiers.

The CRASH_HOTPLUG config option is enabled by default.

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

Comments

Eric DeVolder March 13, 2023, 3:46 p.m. UTC | #1
On 3/12/23 13:11, Sourabh Jain wrote:
> Due to CPU/Memory hotplug events the system resources changes. A similar
> change should reflect in the loaded kdump kernel image that describes
> the state of the CPU and memory of the running kernel.
> 
> If the kdump kernel image is not updated after the CPU or Memory hotplug
> events and it tries to collect the dump with the stale system resource
> data this might lead to dump collection failure or an inaccurate dump
> collection.
> 
> The current method to keep the kdump kernel up to date is by triggering
> reload (i.e unload and load) the entire kdump kernel image whenever a
> CPU or Memory hotplug event is observed by udev in the userspace.
> Reloading the complete kdump kernel image is an expensive task. It can
> be easily avoided by doing the in-kernel updates to specific kdump
> kernel image components which are responsible for describing CPU and
> Memory resources of the running kernel to the kdump kernel.
> 
> The kernel changes related to in-kernel update to the kdump kernel image
> on CPU/Memory hotplug events are kept under the CRASH_HOTPLUG config
> option.
> 
> Later in the series, a powerpc crash hotplug handler is introduced to
> update the kdump kernel image on CPU/Memory hotplug events. This arch
> specific handler is trigger from a generic crash handler that registers
> with the CPU and memory notifiers.
> 
> The CRASH_HOTPLUG config option is enabled by default.
> 
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
>   arch/powerpc/Kconfig | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index a6c4407d3ec83..2f45b3f5175cb 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 "Update crash capture system on CPU/Memory hotplug event"
Fwiw, online/offline changes also flow through this infrastructure...
eric

> +	default y
> +	depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG)
> +	help
> +	  In kernel update to relevant kexec segments due to change
> +	  in the system configuration, rather reloading all the kexec
> +	  segments again from userspace by monitoring CPU/Memory
> +	  hotplug events in the userspace using udev.
> +
> +	  If unsure, say N.
> +
>   config FA_DUMP
>   	bool "Firmware-assisted dump"
>   	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
Sourabh Jain March 14, 2023, 5:17 a.m. UTC | #2
On 13/03/23 21:16, Eric DeVolder wrote:
>
>
> On 3/12/23 13:11, Sourabh Jain wrote:
>> Due to CPU/Memory hotplug events the system resources changes. A similar
>> change should reflect in the loaded kdump kernel image that describes
>> the state of the CPU and memory of the running kernel.
>>
>> If the kdump kernel image is not updated after the CPU or Memory hotplug
>> events and it tries to collect the dump with the stale system resource
>> data this might lead to dump collection failure or an inaccurate dump
>> collection.
>>
>> The current method to keep the kdump kernel up to date is by triggering
>> reload (i.e unload and load) the entire kdump kernel image whenever a
>> CPU or Memory hotplug event is observed by udev in the userspace.
>> Reloading the complete kdump kernel image is an expensive task. It can
>> be easily avoided by doing the in-kernel updates to specific kdump
>> kernel image components which are responsible for describing CPU and
>> Memory resources of the running kernel to the kdump kernel.
>>
>> The kernel changes related to in-kernel update to the kdump kernel image
>> on CPU/Memory hotplug events are kept under the CRASH_HOTPLUG config
>> option.
>>
>> Later in the series, a powerpc crash hotplug handler is introduced to
>> update the kdump kernel image on CPU/Memory hotplug events. This arch
>> specific handler is trigger from a generic crash handler that registers
>> with the CPU and memory notifiers.
>>
>> The CRASH_HOTPLUG config option is enabled by default.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> ---
>>   arch/powerpc/Kconfig | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index a6c4407d3ec83..2f45b3f5175cb 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 "Update crash capture system on CPU/Memory hotplug event"
> Fwiw, online/offline changes also flow through this infrastructure...
> eric
Yes I will update the CONFIG summary and commit message to convey
the same.

Thanks for the review.

Thanks,
Sourabh Jain
diff mbox series

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a6c4407d3ec83..2f45b3f5175cb 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 "Update crash capture system on CPU/Memory hotplug event"
+	default y
+	depends on CRASH_DUMP && (HOTPLUG_CPU || MEMORY_HOTPLUG)
+	help
+	  In kernel update to relevant kexec segments due to change
+	  in the system configuration, rather reloading all the kexec
+	  segments again from userspace by monitoring CPU/Memory
+	  hotplug events in the userspace using udev.
+
+	  If unsure, say N.
+
 config FA_DUMP
 	bool "Firmware-assisted dump"
 	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)