Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Document/kexec: generalize crash hotplug description

Commit 79365026f869 ("crash: add a new kexec flag for hotplug support")
generalizes the crash hotplug support to allow architectures to update
multiple kexec segments on CPU/Memory hotplug and not just elfcorehdr.
Therefore, update the relevant kernel documentation to reflect the same.

No functional change.

Link: https://lkml.kernel.org/r/20240812041651.703156-1-sourabhjain@linux.ibm.com
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Petr Tesarik <ptesarik@suse.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Petr Tesarik <petr@tesarici.cz>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Sourabh Jain and committed by
Andrew Morton
c91c6062 caaab566

+35 -25
+3 -3
Documentation/ABI/testing/sysfs-devices-memory
··· 115 115 Date: Aug 2023 116 116 Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 117 117 Description: 118 - (RO) indicates whether or not the kernel directly supports 119 - modifying the crash elfcorehdr for memory hot un/plug and/or 120 - on/offline changes. 118 + (RO) indicates whether or not the kernel updates relevant kexec 119 + segments on memory hot un/plug and/or on/offline events, avoiding the 120 + need to reload kdump kernel.
+3 -3
Documentation/ABI/testing/sysfs-devices-system-cpu
··· 704 704 Date: Aug 2023 705 705 Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 706 706 Description: 707 - (RO) indicates whether or not the kernel directly supports 708 - modifying the crash elfcorehdr for CPU hot un/plug and/or 709 - on/offline changes. 707 + (RO) indicates whether or not the kernel updates relevant kexec 708 + segments on memory hot un/plug and/or on/offline events, avoiding the 709 + need to reload kdump kernel. 710 710 711 711 What: /sys/devices/system/cpu/enabled 712 712 Date: Nov 2022
+3 -2
Documentation/admin-guide/mm/memory-hotplug.rst
··· 294 294 ``crash_hotplug`` read-only: when changes to the system memory map 295 295 occur due to hot un/plug of memory, this file contains 296 296 '1' if the kernel updates the kdump capture kernel memory 297 - map itself (via elfcorehdr), or '0' if userspace must update 298 - the kdump capture kernel memory map. 297 + map itself (via elfcorehdr and other relevant kexec 298 + segments), or '0' if userspace must update the kdump 299 + capture kernel memory map. 299 300 300 301 Availability depends on the CONFIG_MEMORY_HOTPLUG kernel 301 302 configuration option.
+6 -4
Documentation/core-api/cpu_hotplug.rst
··· 737 737 738 738 When changes to the CPUs in the system occur, the sysfs file 739 739 /sys/devices/system/cpu/crash_hotplug contains '1' if the kernel 740 - updates the kdump capture kernel list of CPUs itself (via elfcorehdr), 741 - or '0' if userspace must update the kdump capture kernel list of CPUs. 740 + updates the kdump capture kernel list of CPUs itself (via elfcorehdr and 741 + other relevant kexec segment), or '0' if userspace must update the kdump 742 + capture kernel list of CPUs. 742 743 743 744 The availability depends on the CONFIG_HOTPLUG_CPU kernel configuration 744 745 option. ··· 751 750 SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end" 752 751 753 752 For a CPU hot un/plug event, if the architecture supports kernel updates 754 - of the elfcorehdr (which contains the list of CPUs), then the rule skips 755 - the unload-then-reload of the kdump capture kernel. 753 + of the elfcorehdr (which contains the list of CPUs) and other relevant 754 + kexec segments, then the rule skips the unload-then-reload of the kdump 755 + capture kernel. 756 756 757 757 Kernel Inline Documentations Reference 758 758 ======================================
+20 -13
kernel/crash_core.c
··· 505 505 crash_hotplug_lock(); 506 506 /* Obtain lock while reading crash information */ 507 507 if (!kexec_trylock()) { 508 - pr_info("kexec_trylock() failed, elfcorehdr may be inaccurate\n"); 508 + pr_info("kexec_trylock() failed, kdump image may be inaccurate\n"); 509 509 crash_hotplug_unlock(); 510 510 return 0; 511 511 } ··· 520 520 } 521 521 522 522 /* 523 - * To accurately reflect hot un/plug changes of cpu and memory resources 524 - * (including onling and offlining of those resources), the elfcorehdr 525 - * (which is passed to the crash kernel via the elfcorehdr= parameter) 526 - * must be updated with the new list of CPUs and memories. 523 + * To accurately reflect hot un/plug changes of CPU and Memory resources 524 + * (including onling and offlining of those resources), the relevant 525 + * kexec segments must be updated with latest CPU and Memory resources. 527 526 * 528 - * In order to make changes to elfcorehdr, two conditions are needed: 529 - * First, the segment containing the elfcorehdr must be large enough 530 - * to permit a growing number of resources; the elfcorehdr memory size 531 - * is based on NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. 532 - * Second, purgatory must explicitly exclude the elfcorehdr from the 533 - * list of segments it checks (since the elfcorehdr changes and thus 534 - * would require an update to purgatory itself to update the digest). 527 + * Architectures must ensure two things for all segments that need 528 + * updating during hotplug events: 529 + * 530 + * 1. Segments must be large enough to accommodate a growing number of 531 + * resources. 532 + * 2. Exclude the segments from SHA verification. 533 + * 534 + * For example, on most architectures, the elfcorehdr (which is passed 535 + * to the crash kernel via the elfcorehdr= parameter) must include the 536 + * new list of CPUs and memory. To make changes to the elfcorehdr, it 537 + * should be large enough to permit a growing number of CPU and Memory 538 + * resources. One can estimate the elfcorehdr memory size based on 539 + * NR_CPUS_DEFAULT and CRASH_MAX_MEMORY_RANGES. The elfcorehdr is 540 + * excluded from SHA verification by default if the architecture 541 + * supports crash hotplug. 535 542 */ 536 543 static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu, void *arg) 537 544 { ··· 547 540 crash_hotplug_lock(); 548 541 /* Obtain lock while changing crash information */ 549 542 if (!kexec_trylock()) { 550 - pr_info("kexec_trylock() failed, elfcorehdr may be inaccurate\n"); 543 + pr_info("kexec_trylock() failed, kdump image may be inaccurate\n"); 551 544 crash_hotplug_unlock(); 552 545 return; 553 546 }