Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Signed-off-by: Pingfan Liu piliu@redhat.com --- dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() { + local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules + + sed -i '/SUBSYSTEM=="cpu"/d' $file +} + install() { + local arch + kdump_module_init kdump_install_conf remove_sysctl_conf
+ # Onlining secondary cpus breaks kdump completely on KVM on Power hosts + # Though we use maxcpus=1 by default but 40-redhat.rules will bring up all + # possible cpus by default. (rhbz1270174 rhbz1266322) + # Thus before we get the kernel fix and the systemd rule fix let's remove + # the cpu online rule in kdump initramfs. + arch=$(uname -m) + if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then + remove_cpu_online_rule + fi + if is_ssh_dump_target; then kdump_install_random_seed fi
On Thu, Dec 16, 2021 at 11:15:32AM +0800, Pingfan Liu wrote:
Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Only two small issues.
Signed-off-by: Pingfan Liu piliu@redhat.com
dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' $file
^^^^^ "$file" otherwise shellcheck would complaint about "SC2086: Double quote to prevent globbing and word splitting."
+}
install() {
local arch
kdump_module_init kdump_install_conf remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
There is no need to quote string constants.
remove_cpu_online_rule
- fi
- if is_ssh_dump_target; then kdump_install_random_seed fi
-- 2.31.1
On Thu, Dec 16, 2021 at 3:10 PM Coiby Xu coxu@redhat.com wrote:
On Thu, Dec 16, 2021 at 11:15:32AM +0800, Pingfan Liu wrote:
Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Only two small issues.
Signed-off-by: Pingfan Liu piliu@redhat.com
dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' $file
^^^^^ "$file"
otherwise shellcheck would complaint about "SC2086: Double quote to prevent globbing and word splitting."
+}
install() {
local arch
kdump_module_init kdump_install_conf remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
There is no need to quote string constants.
Can we shrink 2 [[ ]] into 1 like:
if [[ "$arch" = "ppc64le" || "$arch" = "ppc64" ]]; then
Thanks, Tao Liu
remove_cpu_online_rule
- fi
- if is_ssh_dump_target; then kdump_install_random_seed fi
-- 2.31.1
-- Best regards, Coiby
On Thu, Dec 16, 2021 at 4:00 PM Tao Liu ltao@redhat.com wrote:
On Thu, Dec 16, 2021 at 3:10 PM Coiby Xu coxu@redhat.com wrote:
On Thu, Dec 16, 2021 at 11:15:32AM +0800, Pingfan Liu wrote:
Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Only two small issues.
Signed-off-by: Pingfan Liu piliu@redhat.com
dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' $file
^^^^^ "$file"
otherwise shellcheck would complaint about "SC2086: Double quote to prevent globbing and word splitting."
+}
install() {
local arch
kdump_module_init kdump_install_conf remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
There is no need to quote string constants.
Can we shrink 2 [[ ]] into 1 like:
if [[ "$arch" = "ppc64le" || "$arch" = "ppc64" ]]; then
[[ ]] is alias of test. and man test, there is an example 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2'
So I think merging is not a good choice, which is similar to C convention instead of bash.
Thanks,
Pingfan
On Thu, Dec 16, 2021 at 7:32 PM Pingfan Liu piliu@redhat.com wrote:
On Thu, Dec 16, 2021 at 4:00 PM Tao Liu ltao@redhat.com wrote:
On Thu, Dec 16, 2021 at 3:10 PM Coiby Xu coxu@redhat.com wrote:
On Thu, Dec 16, 2021 at 11:15:32AM +0800, Pingfan Liu wrote:
Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Only two small issues.
Signed-off-by: Pingfan Liu piliu@redhat.com
dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' $file
^^^^^ "$file"
otherwise shellcheck would complaint about "SC2086: Double quote to prevent globbing and word splitting."
+}
install() {
local arch
kdump_module_init kdump_install_conf remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
There is no need to quote string constants.
Can we shrink 2 [[ ]] into 1 like:
if [[ "$arch" = "ppc64le" || "$arch" = "ppc64" ]]; then
[[ ]] is alias of test. and man test, there is an example 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2'
So I think merging is not a good choice, which is similar to C convention instead of bash.
Yeah, I'm OK with it, just thought after the shrink you can invoke the test once instead of twice, just my idea...
Thanks, Tao Liu
Thanks,
Pingfan
On Thu, Dec 16, 2021 at 3:10 PM Coiby Xu coxu@redhat.com wrote:
On Thu, Dec 16, 2021 at 11:15:32AM +0800, Pingfan Liu wrote:
Onlining secondary cpus breaks kdump completely on KVM on Power hosts Though we use maxcpus=1 by default but 40-redhat.rules will bring up all possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young dyoung@redhat.com
Only two small issues.
Signed-off-by: Pingfan Liu piliu@redhat.com
dracut-module-setup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1ea0d95..2c7b728 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() { echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf" }
+remove_cpu_online_rule() {
- local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' $file
^^^^^ "$file"
otherwise shellcheck would complaint about "SC2086: Double quote to prevent globbing and word splitting."
OK, will fix it in V2
+}
install() {
local arch
kdump_module_init kdump_install_conf remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
There is no need to quote string constants.
Here, I am not sure. For bash convention, is it usual to use quotes around strings? E.g. local hostname="people.redhat.com"
Thanks, Pingfan