kexec-tools/98-kexec.rules.ppc64
Baoquan He 69d61bb3e3
update 98-kexec rules for crash hotplug
In kernel, with the support of cpu/memory hotplug on crash, kdump
reloading only needs to update the elfcorehdr.

To realize the benefits, we need prevent udev from updating kdump
kernel on hot un/plug changes when detecting that the crash_hotplug
sysfs nodes are present.

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/?id=d68b4b6f307d155475cce541f2aee938032ed22e
Signed-off-by: Baoquan He <bhe@redhat.com>
2024-05-31 11:32:26 +08:00

27 lines
1.1 KiB
Plaintext

# 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"
GOTO="kdump_reload_end"
# If kdump is not loaded, calling kdump-udev-throttle will end up
# doing nothing, but systemd-run will always generate extra logs for
# each call, so trigger the kdump-udev-throttler only if kdump
# service is active to avoid unnecessary logs
LABEL="kdump_reload_mem"
RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
GOTO="kdump_reload_end"
LABEL="kdump_reload_cpu"
RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; ! test -f /sys/kernel/fadump/enabled || cat /sys/kernel/fadump/enabled | grep 0 || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
LABEL="kdump_reload_end"