x86-crash-optimize-cpu-changes.patch removed from -mm tree
The quilt patch titled
Subject: x86/crash: optimize CPU changes
has been removed from the -mm tree. Its filename was
x86-crash-optimize-cpu-changes.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Eric DeVolder <[email protected]>
Subject: x86/crash: optimize CPU changes
Date: Mon, 14 Aug 2023 17:44:46 -0400
crash_prepare_elf64_headers() writes into the elfcorehdr an ELF PT_NOTE for all possible CPUs. As such, subsequent changes to CPUs (ie. hot un/plug, online/offline) do not need to rewrite the elfcorehdr.
The kimage->file_mode term covers kdump images loaded via the kexec_file_load() syscall. Since crash_prepare_elf64_headers() wrote the initial elfcorehdr, no update to the elfcorehdr is needed for CPU changes.
The kimage->elfcorehdr_updated term covers kdump images loaded via the kexec_load() syscall. At least one memory or CPU change must occur to cause crash_prepare_elf64_headers() to rewrite the elfcorehdr. Afterwards, no update to the elfcorehdr is needed for CPU changes.
This code is intentionally *NOT* hoisted into crash_handle_hotplug_event() as it would prevent the arch-specific handler from running for CPU changes. This would break PPC, for example, which needs to update other information besides the elfcorehdr, on CPU changes.
---
arch/x86/kernel/crash.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/kernel/crash.c renamed from arch/x86/kernel/crash.c~x86-crash-optimize-cpu-changes +10 -0
@@ -470,6 +470,16 @@ void arch_crash_handle_hotplug_event(strunsigned long elfsz =0 ;/* +* As crash_prepare_elf64_headers() has already described all +* possible CPUs, there is no need to update the elfcorehdr +* for additional CPU changes. +*/ +if ((image->file_mode || image->elfcorehdr_updated) && + ((image->hp_action ==KEXEC_CRASH_HP_ADD_CPU ) || + (image->hp_action ==KEXEC_CRASH_HP_REMOVE_CPU ))) +return ; + +/* * Create the new elfcorehdr reflecting the changes to CPU and/or * memory resources. */
_
Patches currently in -mm which might be from [email protected] are