Stop reloading kdump service on CPU hotplug event for FADump

Resolves: bz1924116
Upstream: fedora
Conflict: none

commit 6a2e820d87
Author: Sourabh Jain <sourabhjain@linux.ibm.com>
Date:   Sun Feb 21 17:23:37 2021 +0530

    Stop reloading kdump service on CPU hotplug event for FADump

    As FADump does not require an explicit elfcorehdr update whenever there is CPU
    hotplug event so let's stop kdump service reload for FADump when CPU hotplug
    event is triggered.

    A new label is added to handle CPU and memory hotplug events separately. The
    updated CPU hotplug event handler make sure that kdump service should not be
    reloaded when FADump is configured.

    Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
    Reviewed-by: Pingfan Liu <piliu@redhat.com>
    Acked-by: Baoquan He <bhe@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Tao Liu 2021-05-14 11:32:51 +08:00
parent 325662490f
commit 3e44dae49a

View File

@ -1,15 +1,22 @@
SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload"
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload"
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"
LABEL="kdump_reload"
# 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"