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 --- 98-kexec.rules.ppc64 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64 index 1a91220..a1c00a9 100644 --- a/98-kexec.rules.ppc64 +++ b/98-kexec.rules.ppc64 @@ -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"
On 02/21/21 at 05:23pm, Sourabh Jain wrote:
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
98-kexec.rules.ppc64 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64 index 1a91220..a1c00a9 100644 --- a/98-kexec.rules.ppc64 +++ b/98-kexec.rules.ppc64 @@ -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"
This looks good to me. It splits the cpu/mem hotplug and checks FADump separately for special handling, seems no harm.
Acked-by: Baoquan He bhe@redhat.com
Thanks Baoquan
On 2/21/21 7:53 PM, Sourabh Jain wrote:
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
98-kexec.rules.ppc64 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64 index 1a91220..a1c00a9 100644 --- a/98-kexec.rules.ppc64 +++ b/98-kexec.rules.ppc64 @@ -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'"
The statement "! test -f /sys/kernel/fadump_enabled || cat /sys/kernel/fadump_enabled | grep 0 || exit 0;" can not exit on my x86 machine. And I think it is the same case on powerKVM guest
Thanks, Pingfan
- LABEL="kdump_reload_end"
On 3/3/21 10:24 AM, piliu wrote:
On 2/21/21 7:53 PM, Sourabh Jain wrote:
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
98-kexec.rules.ppc64 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64 index 1a91220..a1c00a9 100644 --- a/98-kexec.rules.ppc64 +++ b/98-kexec.rules.ppc64 @@ -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'"
The statement "! test -f /sys/kernel/fadump_enabled || cat /sys/kernel/fadump_enabled | grep 0 || exit 0;" can not exit on my x86 machine. And I think it is the same case on powerKVM guest
Oh, I made a mistake, that is exceptional behavior. Reviewed-by: Pingfan Liu piliu@redhat.com
Hello Pingfan,
Thanks for the review.
Yes for x86 we do not have have fadump_enabled node so it is not suppose to exit.
Thanks, Sourabh Jain