[PATCH v2] mkdumprd: Fix the bug to get persistent device correctly
by Minfei Huang
Persistent device name is an uuid in directory /dev/disk/by-uuid which
can determine the unique devices by soft link. The uuid is created, once
the device are formated by command mkfs, and one filesystem has an
unique uuid to detect itself.
For btrfs, one filesystem may contain several devices. So it may fail to
find the device from the /dev/disk/by-uuid as usual, because
/dev/disk/by-uuid/* only points to the one of the several devices by the
soft link, although there is a filesystem on the devices.
In order to get the persistent device, we can use command "blkid",
instead of finding it in directory /dev/disk/by-uuid directly.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
v1:
- describe the commit log more detail
---
mkdumprd | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index 8cf3c7b..52d560e 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -30,14 +30,14 @@ perror() {
}
get_persistent_dev() {
- local i _tmp _dev
+ local i _tmp _dev _uuid
_dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
[ -z "$_dev" ] && {
perror_exit "Kernel dev name of $1 is not found."
}
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
+ for i in /dev/mapper/* /dev/disk/by-id/*; do
_tmp=$(udevadm info --query=name --name="$i" 2>/dev/null)
if [ "$_tmp" = "$_dev" ]; then
echo $i
@@ -45,6 +45,18 @@ get_persistent_dev() {
fi
done
+ if [ "x" != "x""$(blkid $1 | grep "UUID")" ]; then
+ _uuid=`blkid $1 | grep "UUID" | awk '{print $2}'`
+ _uuid=${_uuid#*\"}
+ _uuid=${_uuid%\"*}
+ _dev=/dev/disk/by-uuid/$_uuid
+ _tmp=$(udevadm info --query=name --name=$_dev 2>/dev/null)
+ if [ "x" != "x"$_tmp ]; then
+ echo $_dev
+ return
+ fi
+ fi
+
perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name"
echo $1
}
--
1.9.3
8 years, 10 months
[PATCH v2] Enhance kdump.conf "default" parameters check.
by Qiao Zhao
According to man page, default option can only use reboot, halt, poweroff,
shell and dump_to_rootfs as parameter.
Currently, if configuration kdump.conf is:
------
path /var/crash
core_collector makedumpfile -nosuchfile
default no_such_option
------
kdump service still can be started.
Adding function "check_default_config" to kdumpctl file can solve
this problem.
I have tested this patch in my test machine(Fedora-21).
v1 --> v2
Baoquan He point "check_default_config" function should be call in
"check_config" function.
Wang Li point if kdump.conf donesn't configure the "default" option,
kdump serivce will fail.
Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
---
kdumpctl | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index ca053a1..6161c77 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -259,6 +259,8 @@ check_config()
esac
done < $KDUMP_CONFIG_FILE
+ check_default_config || return 1
+
check_fence_kdump_config || return 1
return 0
@@ -781,6 +783,25 @@ start_dump()
return $?
}
+check_default_config()
+{
+ local default_option
+
+ default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
+ if [ -z $default_option ]; then
+ return 0
+ else
+ case "$default_option" in
+ reboot|halt|poweroff|shell|dump_to_rootfs)
+ return 0
+ ;;
+ *)
+ echo $"Usage kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}"
+ return 1
+ esac
+ fi
+}
+
start()
{
check_config
--
1.9.3
8 years, 10 months
[PATCH] kexec-kdump-howto: Add notes on how to use multiple cpus on x86 system
by HATAYAMA Daisuke
Add notes on how to use multiple cpus on x86 system. That is, these
are about two kernel options, disable_cpus_apicid and nr_cpus.
I also wrote note on memory consumption issue about nr_cpus option.
In the notes, I kept x86 hardware issue just a little in order to
avoid too detailed description.
I didn't write any concrete example on makedumpfile usage for parallel
processing since we have not decided official way on kexec-tools.
Signed-off-by: HATAYAMA Daisuke <d.hatayama(a)jp.fujitsu.com>
---
kexec-kdump-howto.txt | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 7ffeab9..3600ec4 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -537,6 +537,39 @@ dump data from stdard input to a normal dumpfile (readable with analysis
tools).
For example: "makedumpfile -R vmcore < vmcore.flat"
+Notes on how to use multiple cpus on a capture kernel on x86 system
+
+To use multiple cpus on a capture kernel on x86 system:
+
+- First, confirm that you are using a sufficiently new kernel version
+ that supports disable_cpu_apicid kernel option as a capture kernel,
+ which is needed to avoid x86 specific hardware issue (*). The
+ disable_cpu_apicid kernel option is automatically appended by
+ kdumpctl script and is ignored if the kernel doesn't support
+ it. Thus, you don't need to do anything else except for the
+ confirmation.
+
+- Then, you need to specify how many cpus you use in a capture kernel
+ by specifying the number of cpus in nr_cpus kernel option in
+ /etc/sysconfig/kdump. nr_cpus is 1 at default.
+
+Note strongly that you should use necessary and sufficnet amount of
+cpus on a capture kernel. IOW, don't use too many cpus on a capture
+kernel, or the capture kernel easily leads to panic due to Out Of
+Memory.
+
+There are kernel data structures and drivers allocating memory in
+proportion to the number of cpus. More you use cpus, more and more
+memory system consumes. Memory is rare, limited resource in a capture
+kernel. Reserved memory should be kept as less as possible. When
+configuring nr_cpus option, you should confirm that kdump certainly
+successfully works without leading to panic due to Out Of Memory on a
+capture kernel.
+
+(*) Without disable_cpu_apicid kernel option, capture kernel leads to
+hang, system reset or power-off at boot, depending on your system and
+runtime situation at the time of crash.
+
Caveats:
Console frame-buffers and X are not properly supported. If you typically run
--
1.8.5.3
8 years, 10 months
Question: is there any automated way of building rpm package?
by HATAYAMA Daisuke
Hello,
Is there any automated way of building rpm package?
That is, installing files such eppic, kexec-tools-po, makedumpfile and kexec-tools with expected file names necessary for installation, place them proper file path location and then execute rpmbuild command.
I first found out there's no Makefile and INSTALL file, and then I tried preparing them manually in an ad-hoc way, but faced build failure several times and gave up.
--
Thanks.
HATAYAMA, Daisuke
8 years, 10 months
[PATCH V3] Disable transparent hugepages in second kernel
by Li Wang
Transparent hugepages are on by default. Disable it in kdump kernel by
adding the parameter 'transparent_hugepage=never'. This might help us
with some of the memory issues we are facing.
>From my test on two arch, not only there are no any bad effect on saving vmcore
after turn off THP, but also we can get more 'MemAvailable:' in the kdump kernel.
1)x86_64
without the parameter
=====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/rhel_ibm--x3250m4--01-root ro rd.lvm.lv=rhel_ibm-x3250m4-01/swap console=ttyS0,115200n8 rd.lvm.lv=rhel_ibm-x3250m4-01/root LANG=en_US.UTF-8 irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0 elfcorehdr=869764K
kdump:/# cat /proc/meminfo
MemTotal: 145492 kB
MemFree: 68284 kB
MemAvailable: 111632 kB <<------
Buffers: 36 kB
Cached: 48184 kB
...
added the parameter
=====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/rhel_ibm--x3250m4--01-root ro rd.lvm.lv=rhel_ibm-x3250m4-01/swap console=ttyS0,115200n8 rd.lvm.lv=rhel_ibm-x3250m4-01/root LANG=en_US.UTF-8 irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never disable_cpu_apicid=0 elfcorehdr=869764K
kdump:/# cat /proc/meminfo
MemTotal: 145492 kB
MemFree: 68388 kB
MemAvailable: 111728 kB <<-------
...
VmallocChunk: 34359659520 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
...
2)ppc64
without the parameter
====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.ppc64 root=/dev/mapper/rhel_ibm--p8--05--lp6-root ro rd.lvm.lv=rhel_ibm-p8-05-lp6/root rd.lvm.lv=rhel_ibm-p8-05-lp6/swap LANG=en_US.UTF-8 irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 elfcorehdr=154880K
kdump:/# cat /proc/meminfo
MemTotal: 480832 kB
MemFree: 293952 kB
MemAvailable: 427840 kB <<--------
mallocUsed: 23680 kB
VmallocChunk: 8589901824 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
...
added the parameter
===================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.ppc64 root=/dev/mapper/rhel_ibm--p8--05--lp6-root ro rd.lvm.lv=rhel_ibm-p8-05-lp6/root rd.lvm.lv=rhel_ibm-p8-05-lp6/swap LANG=en_US.UTF-8 irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never elfcorehdr=154880K
kdump:/# cat /proc/meminfo
MemTotal: 480832 kB
MemFree: 294592 kB
MemAvailable: 428480 kB <<-------
...
HugePages_Total: 0
Signed-off-by: Li Wang <liwang(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.ppc64le | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 84b2447..bb7a6e5 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 rootflags=nofail"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 rootflags=nofail transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 5295626..dd09598 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 5295626..dd09598 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 745dd27..b103a88 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 rootflags=nofail"
+KDUMP_COMMANDLINE_APPEND="nr_cpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 rootflags=nofail transparent_hugepage=never"
# Any additional /sbin/mkdumprd arguments required.
MKDUMPRD_ARGS=""
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index d9ad9b5..7991d68 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never"
# Any additional kexec arguments required. In most situations, this should
# be left empty
--
1.8.3.1
8 years, 10 months
[PATCH] Enhance kdump.conf "default" parameters check.
by Qiao Zhao
According to man page, default can only use reboot, halt, poweroff,
shell and dump_to_rootfs as parameter.
Currently, if configuration kdump.conf:
------
path /var/crash
core_collector makedumpfile -nosuchfile
default no_such_option
------
kdump service still can be start.
Add function "check_default_config" to kdumpctl file can solve
this problem.
I have tested this patch in my test machine(Fedora-21).
Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
---
kdumpctl | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index ca053a1..9bb8fe3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -781,6 +781,21 @@ start_dump()
return $?
}
+check_default_config()
+{
+ local default_option
+
+ default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
+ case "$default_option" in
+ reboot|halt|poweroff|shell|dump_to_rootfs)
+ return 0
+ ;;
+ *)
+ echo $"kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}"
+ return 1
+ esac
+}
+
start()
{
check_config
@@ -817,6 +832,12 @@ start()
fi
fi
+ check_default_config
+ if [ $? -ne 0]; then
+ echo "Starting kdump: [FAILED]"
+ return 1
+ if
+
check_rebuild
if [ $? != 0 ]; then
echo "Starting kdump: [FAILED]"
--
1.9.3
8 years, 10 months
[Fedora PATCH v5] Filtered out "noauto" options in 2nd kernel fstab
by Qiao Zhao
Customer found when specify "noauto" option in fstab for nfs mount,
dump failed.
The reason is if "noauto" option is specified in fstab, the mount entry
in fstab related to dump target will passed to dracut and stored in
kdump initrd. Then during kdump kernel boots this entry containing
"noauto" will be ignored by mount service. This cause dump failing.
In fact with "noauto" not only nfs dump will fail, non-root disk dump
will fail too. root disk dump can dump successfully since root disk can
always be mounted by systemd.
So now "noauto" need be filtered out when the fstab entry corresponding
to dump target contains "noauto".
Changelog:
v4 -> v5
code comment is not clear enough. supplement it.
Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
---
mkdumprd | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..b64276e 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -114,6 +114,9 @@ to_mount() {
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
_options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
+ # with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
+ # kernel, filter it out here.
+ _options=$(echo $_options | sed 's/noauto//')
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel
# "x-initrd.mount" mount failure will trigger isolate emergency service
# W/o this, systemd won't isolate, thus we won't get to emergency.
--
1.9.3
8 years, 10 months
[PATCH] mkdumprd: Fix the bug to get persistent device correctly
by Minfei Huang
One filesystem has an unique uuid to detect itself. For btrfs, several
diskes can have the same uuid, and the soft link /dev/disk/by-uuid/$uuid
points the only one disk which is contained in the btrfs.
It may fails to filter out the disk by uuid, although there is a
filesystem on the disk, like btrfs.
In order to get the persistent device, we can use command "blkid".
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
mkdumprd | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index 4d251ba..5fb578b 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -27,14 +27,14 @@ perror() {
}
get_persistent_dev() {
- local i _tmp _dev
+ local i _tmp _dev _uuid
_dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
[ -z "$_dev" ] && {
perror_exit "Kernel dev name of $1 is not found."
}
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
+ for i in /dev/mapper/* /dev/disk/by-id/*; do
_tmp=$(udevadm info --query=name --name="$i" 2>/dev/null)
if [ "$_tmp" = "$_dev" ]; then
echo $i
@@ -42,6 +42,18 @@ get_persistent_dev() {
fi
done
+ if [ "x" != "x""$(blkid $1 | grep "UUID")" ]; then
+ _uuid=`blkid $1 | grep "UUID" | awk '{print $2}'`
+ _uuid=${_uuid#*\"}
+ _uuid=${_uuid%\"*}
+ _dev=/dev/disk/by-uuid/$_uuid
+ _tmp=$(udevadm info --query=name --name=$_dev 2>/dev/null)
+ if [ "x" != "x"$_tmp ]; then
+ echo $_dev
+ return
+ fi
+ fi
+
perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name"
echo $1
}
--
1.9.3
8 years, 11 months