The Linux kernel series "crash: Kernel handling of CPU and memory hot
un/plug" recently landed in mainline. To take advantage of the
performance benefits of that series, 98-kexec.rules needs an update to
optimize the handling of CPU and memory hotplug changes.
It is safe to deploy these rule updates now, ahead of distros/kernels
enabling the feature, since the crash_hotplug sysfs nodes would not be
present and thus the newly introduced rules in 98-kexec would act as a
nop-op and fall thru for legacy behavior. But when distros/kernels
enable the feature, then 98-kexec rules is ready and can properly take
advantage.
Link:
https://lore.kernel.org/lkml/20230814214446.6659-1-eric.devolder@oracle.com/
Link:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
Signed-off-by: Eric DeVolder <eric.devolder(a)oracle.com>
---
98-kexec.rules | 4 ++++
98-kexec.rules.ppc64 | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/98-kexec.rules b/98-kexec.rules
index b73b701..52b2ee8 100644
--- a/98-kexec.rules
+++ b/98-kexec.rules
@@ -1,3 +1,7 @@
+# The kernel updates the crash elfcorehdr for CPU and memory changes
+SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1",
GOTO="kdump_reload_end"
+SUBSYSTEM=="memory", ATTRS{crash_hotplug}=="1",
GOTO="kdump_reload_end"
+
SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload"
SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload"
SUBSYSTEM=="memory", ACTION=="online",
GOTO="kdump_reload"
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64
index a1c00a9..94c8b5d 100644
--- a/98-kexec.rules.ppc64
+++ b/98-kexec.rules.ppc64
@@ -1,3 +1,7 @@
+# The kernel updates the crash elfcorehdr for CPU and memory changes
+SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1",
GOTO="kdump_reload_end"
+SUBSYSTEM=="memory", ATTRS{crash_hotplug}=="1",
GOTO="kdump_reload_end"
+
SUBSYSTEM=="cpu", ACTION=="online",
GOTO="kdump_reload_cpu"
SUBSYSTEM=="memory", ACTION=="online",
GOTO="kdump_reload_mem"
SUBSYSTEM=="memory", ACTION=="offline",
GOTO="kdump_reload_mem"
--
2.39.3