[PATCH RFC] module-setup.sh: install usb serial driver for ttyUSB0
by Dave Young
In case one want to use usb serial console, we need to pack the usb serial
driver into kdump initramfs so that one can see the console output on the usb
console.
I only handled ttyUSB0, this is like a hard code, but it should be enough for
most cases. Also only install the driver for the ttyUSB0 device.
Tested with adding "console=ttyUSB0" in 2nd kernel commandline.
Tested latest F22 kernel, there's CONFIG_USB_SERIAL_CONSOLE=y, kdump work ok.
Signed-off-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 8 ++++++++
1 file changed, 8 insertions(+)
--- kexec-tools.orig/dracut-module-setup.sh
+++ kexec-tools/dracut-module-setup.sh
@@ -626,4 +626,12 @@ installkernel() {
[ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
instmods $wdt
fi
+
+ if [ -c /dev/ttyUSB0 ]; then
+ _majmin=$(get_maj_min /dev/ttyUSB0)
+
+ _driver=$(readlink /sys/dev/char/$_majmin/device/driver)
+ _driver=$(basename $_driver)
+ instmods $_driver
+ fi
}
7 years
[PATCH] dracut-module-setup: Return from iscsi path immediately for hardward iscsi without iBFT
by Minfei Huang
Hardware iscsi can export the iscsi device before starting to load the
kernel code, which setups the iscsi card using the config stored in
hardward iscsi card memory.
kdump need not do anything for this sort of hardware iscsi card, if this
card does not have the feature iBFT. IBFT can export the iscsi
configuration from hardware iscsi card memroy to current running kernel.
Thus iscsiadm cann't get the iscsi session info using "iscsiadm -m
session -r /sys/block/xxx", due to limitation of iscsi info exported by
kernel.
Once the machine is plugged in this sort of hardware iscsi card, kdump
returns as soon as possible.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9b398eb..e2fef9b 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -507,16 +507,6 @@ kdump_setup_iscsi_device() {
local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf"
local initiator_conf="/etc/iscsi/initiatorname.iscsi"
- dinfo "Found iscsi component $1"
-
- # Check once before getting explicit values, so we can output a decent
- # error message.
-
- if ! /sbin/iscsiadm -m session -r ${path} >/dev/null ; then
- derror "Unable to find iscsi record for $path"
- return 1
- fi
-
tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
@@ -583,7 +573,18 @@ kdump_check_iscsi_targets () {
until [[ -d sys || -d iscsi_session ]]; do
cd ..
done
- [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD"
+ if [[ -d iscsi_session ]]; then
+ dinfo "Found iscsi component $PWD"
+
+ # Hardware iscsi without the iBFT will fail to get
+ # iscsi session info, and return non-zero
+ # We need not do anything for this sort of hardware iscsi
+ /sbin/iscsiadm -m session -r "$PWD" 2>&- >/dev/null
+ if [ $? -eq 0 ]; then
+ # start to take care of iBFT
+ kdump_setup_iscsi_device "$PWD"
+ fi
+ fi
)
[[ $hostonly ]] || [[ $mount_needs ]] && {
--
2.1.0
7 years, 8 months
[PATCH V4] kexec-kdump-howto:Add introduction of parallel dumping
by Zhou Wenjian
Add descriptions of parallel dumping and how to use it.
Signed-off-by: Zhou Wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
v3->v4:
1.fix some wrong words
v2->v3:
1.address Baoquan He's comment on disable_cpu_apicid
v1->v2:
1.fix some inappropriate description
2.delete some unnecessary description
kexec-kdump-howto.txt | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 05b497f..b4cdc22 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -616,6 +616,37 @@ options are copied from /proc/cmdline. In general it is best to append
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
the original command line completely.
+Parallel Dumping Operation
+==========================
+Kexec allows kdump using multiple cpus. So parallel feature can accelerate
+dumping substantially, especially in executing compression and filter.
+For example:
+
+ 1."makedumpfile -c --num-threads [THREAD_NUM] /proc/vmcore dumpfile"
+ 2."makedumpfile -c /proc/vmcore dumpfile",
+
+ 1 has better performance than 2, if THREAD_NUM is larger than two
+ and the usable cpus number is larger than THREAD_NUM.
+
+Notes on how to use multiple cpus on a capture kernel on x86 system:
+
+Make sure that you are using a kernel 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.
+
+You need to specify how many cpus to be used 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.
+
+You should use necessary and sufficient number of cpus on a capture kernel.
+Warning: Don't use too many cpus on a capture kernel, or the capture kernel
+may lead to panic due to Out Of Memory.
+
+(*) Without disable_cpu_apicid kernel option, capture kernel may lead to
+hang, system reset or power-off at boot, depending on your system and runtime
+situation at the time of crash.
+
Debugging Tips
--------------
- One can drop into a shell before/after saving vmcore with the help of
--
1.8.3.1
7 years, 8 months
[PATCH V3] kexec-kdump-howto:Add introduction of parallel dumping
by Zhou Wenjian
Add descriptions of parallel dumping and how to use it.
Signed-off-by: Zhou Wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
v2->v3:
1.address Baoquan He's comment on disable_cpu_apicid
v1->v2:
1.fix some inappropriate description
2.delete some unnecessary description
kexec-kdump-howto.txt | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 05b497f..6e49f35 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -616,6 +616,37 @@ options are copied from /proc/cmdline. In general it is best to append
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
the original command line completely.
+Parallel Dumping Operation
+==========================
+Kexec allows kdump using multiple cpus. So parallel feature can accelerate
+dumping substantially, especially in executing compress and filter.
+For example:
+
+ 1."makedumpfile -c --num-threads [THREAD_NUM] /proc/vmcore dumpfile"
+ 2."makedumpfile -c /proc/vmcore dumpfile",
+
+ 1 has better performance than 2, if THREAD_NUM is larger than two
+ and the usable cpus number is larger than THREAD_NUM.
+
+Notes on how to use multiple cpus on a capture kernel on x86 system:
+
+Make sure that you are using a kernel 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.
+
+You need to specify how many cpus to be used 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.
+
+You should use necessary and suffcient number of cpus on a capture kernel.
+IOW, don't use too many cpus on a capture kernel, or the capture kernel may
+lead to panic due to Out Of Memory(each cpu uses about 1MB).
+
+(*) Without disable_cpu_apicid kernel option, capture kernel may lead to
+hang, system reset or power-off at boot, depending on your system and runtime
+situation at the time of crash.
+
Debugging Tips
--------------
- One can drop into a shell before/after saving vmcore with the help of
--
1.8.3.1
7 years, 8 months
[PATCH] dracut-module-setup: Add new lib function write_config_once
by Minfei Huang
To make code more clear, add a new wrapper function to let config write
into file once, if kdump calls it repeatly with the same argument.
Make cleanup in function kdump_setup_iscsi_device.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 37 ++++++++++++-------------------------
kdump-lib.sh | 9 +++++++++
2 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9b398eb..0bf189b 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -497,15 +497,12 @@ kdump_get_iscsi_initiator() {
# No ibft handling yet.
kdump_setup_iscsi_device() {
local path=$1
- local tgt_name; local tgt_ipaddr;
- local username; local password; local userpwd_str;
- local username_in; local password_in; local userpwd_in_str;
- local netdev
- local srcaddr
- local idev
- local netroot_str ; local initiator_str;
+ local tgt_name tgt_ipaddr
+ local username password userpwd_str
+ local username_in password_in userpwd_in_str
+ local netdev srcaddr
+ local netroot_str initiator_str
local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf"
- local initiator_conf="/etc/iscsi/initiatorname.iscsi"
dinfo "Found iscsi component $1"
@@ -542,32 +539,22 @@ kdump_setup_iscsi_device() {
kdump_setup_netdev $netdev $srcaddr
- # prepare netroot= command line
- # FIXME: Do we need to parse and set other parameters like protocol, port
- # iscsi_iface_name, netdev_name, LUN etc.
+ [[ -f $netroot_conf ]] || touch $netroot_conf
if is_ipv6_address $tgt_ipaddr; then
tgt_ipaddr="[$tgt_ipaddr]"
fi
- netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
-
- [[ -f $netroot_conf ]] || touch $netroot_conf
- # If netroot target does not exist already, append.
- if ! grep -q $netroot_str $netroot_conf; then
- echo $netroot_str >> $netroot_conf
- dinfo "Appended $netroot_str to $netroot_conf"
- fi
+ # prepare netroot= command line
+ # FIXME: Do we need to parse and set other parameters like protocol, port
+ # iscsi_iface_name, netdev_name, LUN etc.
+ netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
+ write_config_once "$netroot_str" "$netroot_conf"
# Setup initator
initiator_str=$(kdump_get_iscsi_initiator)
[ $? -ne "0" ] && derror "Failed to get initiator name" && return 1
-
- # If initiator details do not exist already, append.
- if ! grep -q "$initiator_str" $netroot_conf; then
- echo "$initiator_str" >> $netroot_conf
- dinfo "Appended "$initiator_str" to $netroot_conf"
- fi
+ write_config_once "$netroot_str" "$netroot_conf"
}
kdump_check_iscsi_targets () {
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 4d34206..f6217a0 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -230,3 +230,12 @@ is_hostname()
fi
echo $1 | grep -q "[a-zA-Z]"
}
+
+# $1: content to be appended to file
+# $2: target file
+write_config_once()
+{
+ if ! grep -q "$1" "$2"; then
+ echo "$1" >> "$2"
+ fi
+}
--
2.1.0
7 years, 8 months
[PATCH] Remove duplicate prefix path ${initdir}
by Minfei Huang
dracut will place the config in the random path during generating the
initramfs. Remove the duplicate prefix path ${initdir}.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
---
dracut-module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8f78fe4..9597f02 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -336,7 +336,7 @@ kdump_install_net() {
# the default gate way for network dump, eth1 in the fence kdump path will
# call kdump_install_net again and we don't want eth1 to be the default
# gateway.
- if [ ! -f ${initdir}${initdir}/etc/cmdline.d/60kdumpnic.conf ] &&
+ if [ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ] &&
[ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then
echo "kdumpnic=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/60kdumpnic.conf
echo "bootdev=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/70bootdev.conf
--
2.1.0
7 years, 8 months
[PATCH V2] kexec-kdump-howto:Add introduction of parallel dumping
by Zhou Wenjian
Add descriptions of parallel dumping and how to use it.
Signed-off-by: Zhou Wenjian <zhouwj-fnst(a)cn.fujitsu.com>
v1->v2:
1.fix some inappropriate description
2.delete some unnecessary description
---
kexec-kdump-howto.txt | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 05b497f..3a315d1 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -616,6 +616,37 @@ options are copied from /proc/cmdline. In general it is best to append
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
the original command line completely.
+Parallel Dumping Operation
+==========================
+Kexec allows kdump using multiple cpus. So parallel feature can accelerate
+dumping substantially, especially in executing compress and filter.
+For example:
+
+ 1."makedumpfile -c --num-threads [THREAD_NUM] /proc/vmcore dumpfile"
+ 2."makedumpfile -c /proc/vmcore dumpfile",
+
+ 1 has better performance than 2, if THREAD_NUM is larger than two
+ and the usable cpus number is larger than THREAD_NUM.
+
+Notes on how to use multiple cpus on a capture kernel on x86 system:
+
+Make sure that you are using a kernel 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.
+
+You need to specify how many cpus to be used 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.
+
+You should use necessary and suffcient number of cpus on a capture kernel.
+IOW, don't use too many cpus on a capture kernel, or the capture kernel may
+lead to panic due to Out Of Memory(each cpu uses about 1MB).
+
+(*) 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.
+
Debugging Tips
--------------
- One can drop into a shell before/after saving vmcore with the help of
--
1.8.3.1
7 years, 8 months
[PATCH] kexec-kdump-howto:Add introduction of parallel dumping
by Zhou Wenjian
Add descriptions of parallel dumping and how to use it.
Signed-off-by: Zhou Wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
kexec-kdump-howto.txt | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 05b497f..97a319c 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -616,6 +616,38 @@ options are copied from /proc/cmdline. In general it is best to append
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
the original command line completely.
+Parallel Dumping Operation
+==========================
+Kexec allows kdump using multiple cpus. So parallel feature can accelerate
+dumping substantially, especially in executing compress and filter.
+For example:
+
+ 1."makedumpfile -c --num-threads [THREAD_NUM] /proc/vmcore dumpfile"
+ 2."makedumpfile -c /proc/vmcore dumpfile",
+
+ 1 has better performance than 2, if THREAD_NUM is larger than two
+ and the usable cpus number is larger than THREAD_NUM.
+
+Notes on how to use multiple cpus on a capture kernel on x86 system:
+
+Make sure 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.
+
+You need to specify how many cpus to be used 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.
+
+You should use necessary and suffcient amount of cpus on a capture kernel.
+IOW, don't use too many cpus on a capture kernel, or the capture kernel may
+lead to panic due to Out Of Memory(each cpu uses about 1MB).
+
+(*) 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.
+
Debugging Tips
--------------
- One can drop into a shell before/after saving vmcore with the help of
--
1.8.3.1
7 years, 8 months
[PATCH] kexec-kdump-howto:Add introduction of parallel dumping
by Zhou Wenjian
Add descriptions of parallel dumping and how to use it.
Signed-off-by: Zhou wenjian <zhouwj-fnst(a)cn.fujitsu.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com>
---
kexec-kdump-howto.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 05b497f..fab7b09 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -616,6 +616,50 @@ options are copied from /proc/cmdline. In general it is best to append
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
the original command line completely.
+Parallel Dumping Operation
+==========================
+Kexec allows kdump using multiple cpus. So parallel feature can
+accelerate dumping greatly, especially in doing compress and filter.
+For example:
+"makedumpfile -c --num-threads [THREAD_NUM] /proc/vmcore dumpfile"
+has 2 or more times performance of
+"makedumpfile -c /proc/vmcore dumpfile",
+if THREAD_NUM is larger than 2 and the num of cpus that can be used is
+larger than THREAD_NUM.
+
+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.
+
Debugging Tips
--------------
- One can drop into a shell before/after saving vmcore with the help of
--
1.8.3.1
7 years, 8 months
[PATCH v2] Add checking num-threads of makedumpfile
by Zhou Wenjian
A new feature that doing compressing and writing by multi-threads
has been added in makedumpfile. The thread num is specified by
"--num-threads NUM". According to its implementation, there will
be performance degradation if the threads are more than cpus.
So we should check it.
Signed-off-by: Zhou wenjian <zhouwj-fnst(a)cn.fujitsu.com>
---
kdumpctl | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index b504734..fd2abe4 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -259,6 +259,21 @@ check_config()
esac
done < $KDUMP_CONFIG_FILE
+ grep "^core_collector.*makedumpfile" $KDUMP_CONFIG_FILE | grep -q "num-threads"
+ if [ $? -eq 0 ];then
+ local nr_cpus=1
+ local num_threads=0
+ local core_collector=`grep "^core_collector" $KDUMP_CONFIG_FILE`
+
+ num_threads=`echo ${core_collector#*--num-threads} | awk '{print $1}'`
+ nr_cpus=`echo ${KDUMP_COMMANDLINE_APPEND#*nr_cpus=} | awk '{print $1}'`
+
+ if [ $num_threads -ge $nr_cpus ];then
+ echo "The num_threads:$num_threads(specified in /etc/kdump.conf) should be less than nr_cpus:$nr_cpus(specified in /etc/sysconfig/kdump)"
+ echo "or makedumpfile may have bad performance!"
+ fi
+ fi
+
check_fence_kdump_config || return 1
return 0
--
1.7.1
7 years, 9 months