diff mbox series

[RFC,v4,2/5] powerpc/crash hp: introduce a new config option CRASH_HOTPLUG

Message ID 20220411084357.157308-3-sourabhjain@linux.ibm.com (mailing list archive)
State RFC
Headers show
Series [RFC,v4,1/5] powerpc/kexec: make update_cpus_node non-static | expand

Commit Message

Sourabh Jain April 11, 2022, 8:43 a.m. UTC
The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
hotplug events.

All the updates needed on the capture kernel load path in the kernel for
both kexec_load and kexec_file_load system will be kept under this config.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
---
 arch/powerpc/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Laurent Dufour April 14, 2022, 4:40 p.m. UTC | #1
On 11/04/2022, 10:43:54, Sourabh Jain wrote:
> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
> hotplug events.
> 
> All the updates needed on the capture kernel load path in the kernel for
> both kexec_load and kexec_file_load system will be kept under this config.
> 
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>

Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> ---
>  arch/powerpc/Kconfig | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b779603978e1..777db33f75b5 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -623,6 +623,17 @@ config FA_DUMP
>  	  If unsure, say "y". Only special kernels like petitboot may
>  	  need to say "N" here.
>  
> +config CRASH_HOTPLUG
> +	bool "kernel updates of crash kexec segments"
> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
> +	help
> +	  An efficient way to keep the capture kernel up-to-date with CPU
> +	  hotplug events. On CPU hotplug event the kexec segments of capture
> +	  kernel becomes stale and need to be updated with latest CPU data.
> +	  In this method the kernel performs minimal update to only relevant
> +	  kexec segments on CPU hotplug event, instead of triggering full
> +	  capture kernel reload from userspace using udev rule.
> +
>  config PRESERVE_FA_DUMP
>  	bool "Preserve Firmware-assisted dump"
>  	depends on PPC64 && PPC_POWERNV && !FA_DUMP
Sourabh Jain April 19, 2022, 8:20 a.m. UTC | #2
On 14/04/22 22:10, Laurent Dufour wrote:
> On 11/04/2022, 10:43:54, Sourabh Jain wrote:
>> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
>> hotplug events.
>>
>> All the updates needed on the capture kernel load path in the kernel for
>> both kexec_load and kexec_file_load system will be kept under this config.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
> Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

Thanks for the review.

- Sourabh Jain

>
>> ---
>>   arch/powerpc/Kconfig | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index b779603978e1..777db33f75b5 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -623,6 +623,17 @@ config FA_DUMP
>>   	  If unsure, say "y". Only special kernels like petitboot may
>>   	  need to say "N" here.
>>   
>> +config CRASH_HOTPLUG
>> +	bool "kernel updates of crash kexec segments"
>> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
>> +	help
>> +	  An efficient way to keep the capture kernel up-to-date with CPU
>> +	  hotplug events. On CPU hotplug event the kexec segments of capture
>> +	  kernel becomes stale and need to be updated with latest CPU data.
>> +	  In this method the kernel performs minimal update to only relevant
>> +	  kexec segments on CPU hotplug event, instead of triggering full
>> +	  capture kernel reload from userspace using udev rule.
>> +
>>   config PRESERVE_FA_DUMP
>>   	bool "Preserve Firmware-assisted dump"
>>   	depends on PPC64 && PPC_POWERNV && !FA_DUMP
Michael Ellerman April 21, 2022, 11:34 a.m. UTC | #3
Sourabh Jain <sourabhjain@linux.ibm.com> writes:
> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
> hotplug events.
>
> All the updates needed on the capture kernel load path in the kernel for
> both kexec_load and kexec_file_load system will be kept under this config.
>
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
> ---
>  arch/powerpc/Kconfig | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b779603978e1..777db33f75b5 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -623,6 +623,17 @@ config FA_DUMP
>  	  If unsure, say "y". Only special kernels like petitboot may
>  	  need to say "N" here.
>  
> +config CRASH_HOTPLUG
> +	bool "kernel updates of crash kexec segments"
> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
> +	help
> +	  An efficient way to keep the capture kernel up-to-date with CPU
> +	  hotplug events. On CPU hotplug event the kexec segments of capture
> +	  kernel becomes stale and need to be updated with latest CPU data.
> +	  In this method the kernel performs minimal update to only relevant
> +	  kexec segments on CPU hotplug event, instead of triggering full
> +	  capture kernel reload from userspace using udev rule.

Why would a user ever want to turn this off?

Seems to me we should just make it always behave this way, and not have
a CONFIG option at all.

cheers
Eric DeVolder April 21, 2022, 3:29 p.m. UTC | #4
On 4/21/22 06:34, Michael Ellerman wrote:
> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
>> hotplug events.
>>
>> All the updates needed on the capture kernel load path in the kernel for
>> both kexec_load and kexec_file_load system will be kept under this config.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
>> ---
>>   arch/powerpc/Kconfig | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index b779603978e1..777db33f75b5 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -623,6 +623,17 @@ config FA_DUMP
>>   	  If unsure, say "y". Only special kernels like petitboot may
>>   	  need to say "N" here.
>>   
>> +config CRASH_HOTPLUG
>> +	bool "kernel updates of crash kexec segments"
>> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
>> +	help
>> +	  An efficient way to keep the capture kernel up-to-date with CPU
>> +	  hotplug events. On CPU hotplug event the kexec segments of capture
>> +	  kernel becomes stale and need to be updated with latest CPU data.
>> +	  In this method the kernel performs minimal update to only relevant
>> +	  kexec segments on CPU hotplug event, instead of triggering full
>> +	  capture kernel reload from userspace using udev rule.
> 
> Why would a user ever want to turn this off?
> 
> Seems to me we should just make it always behave this way, and not have
> a CONFIG option at all.

Sourabh,

Borislav Petkov also requested I remove the config option, which will be the
case in upcoming v8.

Where I was using CONFIG_CRASH_HOTPLUG, I've replaced it with the
CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_HOTPLUG.

Eric

> 
> cheers
>
Michael Ellerman April 22, 2022, 4:22 a.m. UTC | #5
Eric DeVolder <eric.devolder@oracle.com> writes:
> On 4/21/22 06:34, Michael Ellerman wrote:
>> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>>> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
>>> hotplug events.
>>>
>>> All the updates needed on the capture kernel load path in the kernel for
>>> both kexec_load and kexec_file_load system will be kept under this config.
>>>
>>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>>> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
>>> ---
>>>   arch/powerpc/Kconfig | 11 +++++++++++
>>>   1 file changed, 11 insertions(+)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index b779603978e1..777db33f75b5 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -623,6 +623,17 @@ config FA_DUMP
>>>   	  If unsure, say "y". Only special kernels like petitboot may
>>>   	  need to say "N" here.
>>>   
>>> +config CRASH_HOTPLUG
>>> +	bool "kernel updates of crash kexec segments"
>>> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
>>> +	help
>>> +	  An efficient way to keep the capture kernel up-to-date with CPU
>>> +	  hotplug events. On CPU hotplug event the kexec segments of capture
>>> +	  kernel becomes stale and need to be updated with latest CPU data.
>>> +	  In this method the kernel performs minimal update to only relevant
>>> +	  kexec segments on CPU hotplug event, instead of triggering full
>>> +	  capture kernel reload from userspace using udev rule.
>> 
>> Why would a user ever want to turn this off?
>> 
>> Seems to me we should just make it always behave this way, and not have
>> a CONFIG option at all.
>
> Sourabh,
>
> Borislav Petkov also requested I remove the config option, which will be the
> case in upcoming v8.
>
> Where I was using CONFIG_CRASH_HOTPLUG, I've replaced it with the
> CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_HOTPLUG.

If you're having to spell "CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_HOTPLUG"
in many places then you can still add CONFIG_CRASH_HOTPLUG to represent
the sum of all the dependencies, just don't make it user-selectable.

cheers
Sourabh Jain April 26, 2022, 3:47 a.m. UTC | #6
On 21/04/22 17:04, Michael Ellerman wrote:
> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
>> hotplug events.
>>
>> All the updates needed on the capture kernel load path in the kernel for
>> both kexec_load and kexec_file_load system will be kept under this config.
>>
>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
>> ---
>>   arch/powerpc/Kconfig | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index b779603978e1..777db33f75b5 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -623,6 +623,17 @@ config FA_DUMP
>>   	  If unsure, say "y". Only special kernels like petitboot may
>>   	  need to say "N" here.
>>   
>> +config CRASH_HOTPLUG
>> +	bool "kernel updates of crash kexec segments"
>> +	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
>> +	help
>> +	  An efficient way to keep the capture kernel up-to-date with CPU
>> +	  hotplug events. On CPU hotplug event the kexec segments of capture
>> +	  kernel becomes stale and need to be updated with latest CPU data.
>> +	  In this method the kernel performs minimal update to only relevant
>> +	  kexec segments on CPU hotplug event, instead of triggering full
>> +	  capture kernel reload from userspace using udev rule.
> Why would a user ever want to turn this off?
>
> Seems to me we should just make it always behave this way, and not have
> a CONFIG option at all.


Yes, we don't need a new CONFIG option. Thanks for the suggestion.


Thanks,
Sourabh Jain
Sourabh Jain April 26, 2022, 4:10 a.m. UTC | #7
On 21/04/22 20:59, Eric DeVolder wrote:
>
>
> On 4/21/22 06:34, Michael Ellerman wrote:
>> Sourabh Jain <sourabhjain@linux.ibm.com> writes:
>>> The option CRASH_HOTPLUG enables, in kernel update to kexec segments on
>>> hotplug events.
>>>
>>> All the updates needed on the capture kernel load path in the kernel 
>>> for
>>> both kexec_load and kexec_file_load system will be kept under this 
>>> config.
>>>
>>> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
>>> Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
>>> ---
>>>   arch/powerpc/Kconfig | 11 +++++++++++
>>>   1 file changed, 11 insertions(+)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index b779603978e1..777db33f75b5 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -623,6 +623,17 @@ config FA_DUMP
>>>         If unsure, say "y". Only special kernels like petitboot may
>>>         need to say "N" here.
>>>   +config CRASH_HOTPLUG
>>> +    bool "kernel updates of crash kexec segments"
>>> +    depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
>>> +    help
>>> +      An efficient way to keep the capture kernel up-to-date with CPU
>>> +      hotplug events. On CPU hotplug event the kexec segments of 
>>> capture
>>> +      kernel becomes stale and need to be updated with latest CPU 
>>> data.
>>> +      In this method the kernel performs minimal update to only 
>>> relevant
>>> +      kexec segments on CPU hotplug event, instead of triggering full
>>> +      capture kernel reload from userspace using udev rule.
>>
>> Why would a user ever want to turn this off?
>>
>> Seems to me we should just make it always behave this way, and not have
>> a CONFIG option at all.
>
> Sourabh,
>
> Borislav Petkov also requested I remove the config option, which will 
> be the
> case in upcoming v8.
>
> Where I was using CONFIG_CRASH_HOTPLUG, I've replaced it with the
> CONFIG_HOTPLUG_CPU || CONFIG_MEMORY_HOTPLUG.


Yes good idea. Even Michael suggested there is no need for new CONFIG
option. I will also remove CRASH_HOTPLUG config in the next version.

Thanks,
Sourabh Jain
diff mbox series

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b779603978e1..777db33f75b5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -623,6 +623,17 @@  config FA_DUMP
 	  If unsure, say "y". Only special kernels like petitboot may
 	  need to say "N" here.
 
+config CRASH_HOTPLUG
+	bool "kernel updates of crash kexec segments"
+	depends on CRASH_DUMP && (HOTPLUG_CPU) && KEXEC_FILE
+	help
+	  An efficient way to keep the capture kernel up-to-date with CPU
+	  hotplug events. On CPU hotplug event the kexec segments of capture
+	  kernel becomes stale and need to be updated with latest CPU data.
+	  In this method the kernel performs minimal update to only relevant
+	  kexec segments on CPU hotplug event, instead of triggering full
+	  capture kernel reload from userspace using udev rule.
+
 config PRESERVE_FA_DUMP
 	bool "Preserve Firmware-assisted dump"
 	depends on PPC64 && PPC_POWERNV && !FA_DUMP