[PATCH v10 0/5] PowerPC: In-kernel handling of CPU/Memory hotplug/online/offline events for kdump kernel

Sourabh Jain sourabhjain at linux.ibm.com
Mon Apr 24 08:13:19 PDT 2023


On 24/04/23 19:35, Eric DeVolder wrote:
>
>
> On 4/23/23 05:52, Sourabh Jain wrote:
>> The Problem:
>> ============
>> Post CPU/Memory hot plug/unplug and online/offline events the kernel
>> holds stale information about the system. Dump collection with stale
>> kdump kernel might end up in dump capture failure or an inaccurate dump
>> collection.
>>
>> Existing solution:
>> ==================
>> The existing solution to keep the kdump kernel up-to-date by monitoring
>> CPU/Memory hotplug/online/offline events via udev rule and trigger a 
>> full
>> kdump kernel reload for every hotplug event.
>>
>> Shortcomings:
>> ------------------------------------------------
>> - Leaves a window where kernel crash might not lead to a successful dump
>>    collection.
>> - Reloading all kexec components for each hotplug is inefficient.
>> - udev rules are prone to races if hotplug events are frequent.
>>
>> More about issues with an existing solution is posted here:
>>   - https://lkml.org/lkml/2020/12/14/532
>>   - 
>> https://lists.ozlabs.org/pipermail/linuxppc-dev/2022-February/240254.html
>>
>> Proposed Solution:
>> ==================
>> Instead of reloading all kexec segments on CPU/Memory 
>> hotplug/online/offline
>> event, this patch series focuses on updating only the relevant kexec 
>> segment.
>> Once the kexec segments are loaded in the kernel reserved area then an
>> arch-specific hotplug handler will update the relevant kexec segment 
>> based on
>> hotplug event type.
>>
>> Series Dependencies
>> ====================
>> This patch series implements the crash hotplug handler on PowerPC. 
>> The generic
>> crash hotplug handler is introduced by 
>> https://lkml.org/lkml/2023/4/4/1136 patch
>> series.
>>
>> Git tree for testing:
>> =====================
>> The below git tree has this patch series applied on top of dependent 
>> patch
>> series.
>> https://github.com/sourabhjains/linux/tree/e21-s10
>>
>> To realise the feature the kdump udev rule must updated to avoid
>> reloading of kdump reload on CPU/Memory hotplug/online/offline events.
>>
>>    RHEL: /usr/lib/udev/rules.d/98-kexec.rules
>>
>>     -SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload_cpu"
>>     -SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload_mem"
>>     -SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload_mem"
>>     +SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", 
>> GOTO="kdump_reload_end"
>>     +SUBSYSTEM=="memory", ATTRS{crash_hotplug}=="1", 
>> GOTO="kdump_reload_end"
>>
>
> I didn't see in the patch series where you would have the equivalent 
> to the following (needed for the sysfs crash_hotplug entries):
>
> #ifdef CONFIG_HOTPLUG_CPU
> static inline int crash_hotplug_cpu_support(void) { return 1; }
> #define crash_hotplug_cpu_support crash_hotplug_cpu_support
> #endif
>
> #ifdef CONFIG_MEMORY_HOTPLUG
> static inline int crash_hotplug_memory_support(void) { return 1; }
> #define crash_hotplug_memory_support crash_hotplug_memory_support
> #endif

I missed the above diff in my testing environment. Thanks you for 
bringing it
to my attention. I will fix this next version.

- Sourabh Jain



More information about the kexec mailing list