We add a generic dump target hook for kdump, supposed to monitor all the devices mounted by kdump.
PATCH6 implements the basic framework, add a hook kdump_target_hook(), and provide a generic helper kdump_target_check() for use(must use it under mkdump/dracut).
The first five patches are prerequisites for the mechanism, this will ensure us only have one device(our dump target) mounted after kdump boot, there still are corner cases like the special "x-initrd.mount" in /etc/fstab, we can discuss it further to see if we should mount it by kdump or handle it?
PATCH7 is an application of this mechanism(add the "lvm_linear" checklist), if the dump target is linear type lvm volume, we reduce the "reserved_memory" in "/etc/lvm/lvm.conf" from 8MB to 1MB(we discussed this with lvm team, they agree that we can safely set it to 1MB in case of only one lvm linear target).
PATCH8 is another application(add the "lvm" checklist) to remove "lvm" dracut module when no lvm target needed by kdump.
Xunlei Pang (8): kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot kdumpctl: fix the rebuild issue after removing "root=X" Revert "kdumpctl: filter 'root' kernel parameter when running in live images" kdumpctl: move is_fadump_capable() into kdump-lib.sh mkdumprd: add a generic hook for the dump target mkdumprd: reduce lvm2 memory in case of linear volume mkdumprd: omit "lvm" dracut module if no lvm target
dracut-module-setup.sh | 6 +++ dracut-process-lvmconf.sh | 6 +++ kdump-lib.sh | 25 +++++++++ kdumpctl | 36 +++++-------- kexec-tools.spec | 3 ++ mkdumprd | 128 +++++++++++++++++++++++++++++++++++++++------- 6 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 dracut-process-lvmconf.sh
For the following scripts, cmdline="root=/dev/mapper/rhel-root rd.lvm.lv=rhel/root quiet" remove_cmdline_param $cmdline "root"
we will get the result "rd.lvm.lv=rhel/ quiet", after this patch we can get the correct "rd.lvm.lv=rhel/root quiet".
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..b9ff268 100755 --- a/kdumpctl +++ b/kdumpctl @@ -69,7 +69,8 @@ remove_cmdline_param() for arg in $@; do cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ - -e "s/\b$arg\b//g" \ + -e "s/^$arg\b//g" \ + -e "s/[[:space:]]$arg\b//g" \ -e "s/\s+/ /g"` done echo $cmdline
Since the current dracut of Fedora already supports not always mount the root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
We will have only one device mounted in kdump after this patch.
For example, in case of nfs/ssh/usb/etc(non-root) dumping, kdump will not mount the unnecessary root filesystem after this change.
This patch removes "root=X" via "KDUMP_COMMANDLINE_REMOVE" feature, mount the non-root target under "/kdumproot", and the root target still under "/sysroot".
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 2 +- mkdumprd | 29 ++++++++++------------------- 2 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/kdumpctl b/kdumpctl index b9ff268..09901fd 100755 --- a/kdumpctl +++ b/kdumpctl @@ -188,7 +188,7 @@ prepare_cmdline() fi
# These params should always be removed - cmdline=`remove_cmdline_param "$cmdline" crashkernel panic_on_warn` + cmdline=`remove_cmdline_param "$cmdline" crashkernel panic_on_warn root` # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
diff --git a/mkdumprd b/mkdumprd index f30d9c2..892e59a 100644 --- a/mkdumprd +++ b/mkdumprd @@ -80,12 +80,6 @@ add_dracut_sshkey() { add_dracut_arg "--sshkey" "$1" }
-target_is_root() { - local _t - _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1) - [ "$_t" = "/" ] -} - # caller should ensure $1 is valid and mounted in 1st kernel to_mount() { local _dev=$1 _source _target _fstype _options _mntopts _pdev @@ -247,13 +241,13 @@ verify_core_collector() { }
add_mount() { - if ! target_is_root "$1"; then - local _mnt=$(to_mount "$1") - if [ $? -ne 0 ]; then - exit 1 - fi - add_dracut_mount "$_mnt" + local _mnt=$(to_mount "$1") + + if [ $? -ne 0 ]; then + exit 1 fi + + add_dracut_mount "$_mnt" }
get_block_dump_target() @@ -293,13 +287,10 @@ handle_default_dump_target() SAVE_PATH=$_mntpoint/$SAVE_PATH fi
- if [ "$_mntpoint" != "/" ]; then - SAVE_PATH=${SAVE_PATH##"$_mntpoint"} - _fstype=$(get_fs_type_from_target $_target) - - add_mount "$_target" - check_size fs $_target - fi + SAVE_PATH=${SAVE_PATH##"$_mntpoint"} + _fstype=$(get_fs_type_from_target $_target) + add_mount "$_target" + check_size fs $_target }
get_default_action_target()
After removing "root=X" we add the root mount information explicitly from the kdump side, so we need this change to avoid rebuild when the dump target is root.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 09901fd..db38879 100755 --- a/kdumpctl +++ b/kdumpctl @@ -512,11 +512,16 @@ check_dump_fs_modified() fi fi
- if ! findmnt $_target >/dev/null; then - echo "Dump target $_target is probably not mounted." - return 2 - fi - _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)" + if ! findmnt $_target >/dev/null; then + echo "Dump target $_target is probably not mounted." + return 2 + fi + + if [[ "$_target" = "$(get_root_fs_device)" ]]; then + _new_mntpoint="/sysroot/$(get_mntpoint_from_target $_target)" + else + _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)" + fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then
On 03/23/2017 at 04:47 PM, Xunlei Pang wrote:
After removing "root=X" we add the root mount information explicitly from the kdump side, so we need this change to avoid rebuild when the dump target is root.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 09901fd..db38879 100755 --- a/kdumpctl +++ b/kdumpctl @@ -512,11 +512,16 @@ check_dump_fs_modified() fi fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
- if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
- fi
- if [[ "$_target" = "$(get_root_fs_device)" ]]; then
_new_mntpoint="/sysroot/$(get_mntpoint_from_target $_target)"
Oops, this line should be _new_mntpoint="/sysroot"
else
_new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then
This reverts commit 892bea7aa
We already eliminated the root filesystem by removing "root=X", so it's time to revert this commit.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/kdumpctl b/kdumpctl index db38879..baadbd5 100755 --- a/kdumpctl +++ b/kdumpctl @@ -179,10 +179,6 @@ prepare_cmdline()
if [ -z "$KDUMP_COMMANDLINE" ]; then cmdline=`cat /proc/cmdline` - # 'root' parameter will cause kdump failure in live images - if [[ ${cmdline} == *"root=live:"* ]]; then - KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root" - fi else cmdline=${KDUMP_COMMANDLINE} fi
We need is_fadump_capable() definition in kdump-lib.sh
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdump-lib.sh | 12 ++++++++++++ kdumpctl | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 8ebad70..0f74b8e 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -6,6 +6,7 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" +FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
perror_exit() { echo $@ >&2 @@ -406,3 +407,14 @@ get_dracut_args_target() { echo $1 | grep "--mount" | sed "s/.*--mount .(.*)/\1/" | cut -d' ' -f1 } + +is_fadump_capable() +{ + # Check if firmware-assisted dump is enabled + # if no, fallback to kdump check + if [ -f $FADUMP_ENABLED_SYS_NODE ]; then + rc=`cat $FADUMP_ENABLED_SYS_NODE` + [ $rc -eq 1 ] && return 0 + fi + return 1 +} diff --git a/kdumpctl b/kdumpctl index baadbd5..a8db130 100755 --- a/kdumpctl +++ b/kdumpctl @@ -13,7 +13,6 @@ DUMP_TARGET="" DEFAULT_INITRD="" DEFAULT_INITRD_BAK="" TARGET_INITRD="" -FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered" #kdump shall be the default dump mode DEFAULT_DUMP_MODE="kdump" @@ -857,17 +856,6 @@ handle_mode_switch() fi }
-is_fadump_capable() -{ - # Check if firmware-assisted dump is enabled - # if no, fallback to kdump check - if [ -f $FADUMP_ENABLED_SYS_NODE ]; then - rc=`cat $FADUMP_ENABLED_SYS_NODE` - [ $rc -eq 1 ] && return 0 - fi - return 1 -} - check_current_fadump_status() { # Check if firmware-assisted dump has been registered.
We add a generic hook named kdump_target_hook() for the dump target, this is useful for us to do some extra work for different types of dump targets.
kdump_target_check() is exported as a generic helper that can be used as some specific purpose.
We will use this mechanism in the following patch.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdump-lib.sh | 13 ++++++++++ mkdumprd | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 96 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 0f74b8e..aafa21e 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -418,3 +418,16 @@ is_fadump_capable() fi return 1 } + +# $1: item +# Did the item left a tag in the inventory? +# return: 0 means surely left; 1 means surely not +kdump_target_check() +{ + local item=$1 tag + + tag=$(eval echo '${KDUMP_TARGET_TAG_'${item}'}') + [ -n "$tag" ] && return 0 + + return 1 +} diff --git a/mkdumprd b/mkdumprd index 892e59a..392eb7f 100644 --- a/mkdumprd +++ b/mkdumprd @@ -11,6 +11,9 @@ . /lib/kdump/kdump-lib.sh export IN_KDUMP=1
+# See kdump_target_XXX() +KDUMP_TARGET_CHECKLIST="" + conf_file="/etc/kdump.conf" SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2) @@ -250,6 +253,65 @@ add_mount() { add_dracut_mount "$_mnt" }
+# $1: ssh, nfs, or block dev name +kdump_target_hook() +{ + local dev=$1 + + # Do not support fadump currently + if is_fadump_capable; then + return + fi + + # Ignore non-block device currently + if ! [ -b "$dev" ]; then + return + fi + + dev=$(get_persistent_dev $dev) + kdump_target_checklist "$KDUMP_TARGET_CHECKLIST" $dev +} + +# $1: items to be checked +# $2: persistent block dev name +kdump_target_checklist() +{ + local items=$1 pdev=$2 + + for item in $items; do + kdump_target_handle $item $pdev + done +} + +# $1: the item to be checked +# $2: persistent block dev name +# +# You can add an item in KDUMP_TARGET_CHECKLIST, handle it here +# and leave its tag(KDUMP_TARGET_TAG_$item) in the tag inventory +# as needed. +kdump_target_handle() +{ + local item=$1 pdev=$2 + local tag + + tag=KDUMP_TARGET_TAG_$item + # the item handling begins + case "$item" in + *) + echo "unhandled item in kdump target checklist" + return + esac + + kdump_target_leave_tag $tag +} + +# Leave the tag in the tag inventory. +# $1: tag +kdump_target_leave_tag() +{ + eval export $1=1 +} + get_block_dump_target() { local _target @@ -291,6 +353,8 @@ handle_default_dump_target() _fstype=$(get_fs_type_from_target $_target) add_mount "$_target" check_size fs $_target + + kdump_target_hook $_target }
get_default_action_target() @@ -459,6 +523,12 @@ do add_mount "$config_val" check_save_path_fs $_absolute_save_path check_size fs $config_val + + if [ $config_opt = "nfs" ]; then + kdump_target_hook "nfs" + else + kdump_target_hook $config_val + fi ;; raw) #checking raw disk writable @@ -471,6 +541,7 @@ do fi add_dracut_arg "--device" "$_praw" check_size raw $config_val + kdump_target_hook $_praw ;; ssh) if strstr "$config_val" "@"; @@ -478,7 +549,8 @@ do check_size ssh $config_val mkdir_save_path_ssh $config_val add_dracut_module "ssh-client" - add_dracut_sshkey "$SSH_KEY_LOCATION" + add_dracut_sshkey "$SSH_KEY_LOCATION" + kdump_target_hook "ssh" else perror_exit "Bad ssh dump target $config_val" fi @@ -488,6 +560,16 @@ do ;; dracut_args) add_dracut_arg $config_val + + dracut_args_dev=$(get_dracut_args_target "$config_val") + if [ -n "$dracut_args_dev" ]; then + dracut_args_fstype=$(get_dracut_args_fstype "$config_val") + if is_fs_type_nfs $dracut_args_fstype ; then + kdump_target_hook "nfs" + else + kdump_target_hook $dracut_args_dev + fi + fi ;; *) if [ -n $(echo $config_opt | grep "^#.*$") ]
We replace "reserved_memory= 8192" with "reserved_memory = 1024" in /etc/lvm/lvm.conf used by "lvm2", this can save 14MB peak memory consumption, so we lower the possibility of kdump OOM. We only do it in case of linear type lvm volume for safety.
For kdump, we don't have too many lvm targets, lvm2 locates in the RAM(rootfs), so don't need that much memory, 1MB is sufficient.
This patch adds a "lvm_linear" checklist in KDUMP_TARGET_CHECKLIST, and use "kdump_target_is lvm_linear" to insert a dracut hook to modify /etc/lvm/lvm.conf before kdump udev(so lvm2) starts.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- dracut-module-setup.sh | 6 ++++++ dracut-process-lvmconf.sh | 6 ++++++ kexec-tools.spec | 3 +++ mkdumprd | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 dracut-process-lvmconf.sh
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..33a66fd 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -743,4 +743,10 @@ install() { # target. Ideally all this should be pushed into dracut iscsi module # at some point of time. kdump_check_iscsi_targets + + # For the lvm linear type dump target, in /etc/lvm/lvm.conf we can safely replace + # "reserved_memory = 8192" with "reserved_memory = 1024" to lower memory pressure + if kdump_target_check lvmlinear; then + inst_hook pre-udev 99 "$moddir/process-lvmconf.sh" + fi } diff --git a/dracut-process-lvmconf.sh b/dracut-process-lvmconf.sh new file mode 100644 index 0000000..3564213 --- /dev/null +++ b/dracut-process-lvmconf.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# RH BZ1377530 +if [ -f "/etc/lvm/lvm.conf" ]; then + sed -i -e 's/(^[[:space:]]*)reserved_memory[[:space:]]*=[[:space:]]*[[:digit:]]*/\1reserved_memory = 1024/' /etc/lvm/lvm.conf +fi diff --git a/kexec-tools.spec b/kexec-tools.spec index 2a176f3..7c7d115 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -41,6 +41,7 @@ Source103: dracut-kdump-error-handler.sh Source104: dracut-kdump-emergency.service Source105: dracut-kdump-error-handler.service Source106: dracut-kdump-capture.service +Source107: dracut-process-lvmconf.sh
Requires(post): systemd-units Requires(preun): systemd-units @@ -197,8 +198,10 @@ cp %{SOURCE103} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpb cp %{SOURCE104} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE104}} cp %{SOURCE105} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE105}} cp %{SOURCE106} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE106}} +cp %{SOURCE107} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE107}} chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE100}} chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}} +chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE107}}
%define dracutlibdir %{_prefix}/lib/dracut diff --git a/mkdumprd b/mkdumprd index 392eb7f..38b3f12 100644 --- a/mkdumprd +++ b/mkdumprd @@ -12,7 +12,7 @@ export IN_KDUMP=1
# See kdump_target_XXX() -KDUMP_TARGET_CHECKLIST="" +KDUMP_TARGET_CHECKLIST="lvmlinear"
conf_file="/etc/kdump.conf" SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" @@ -297,6 +297,15 @@ kdump_target_handle() tag=KDUMP_TARGET_TAG_$item # the item handling begins case "$item" in + lvmlinear) + if ! [[ $pdev =~ "/dev/mapper/" ]]; then + return + fi + dmsetup table $pdev 2>/dev/null | grep linear &>/dev/null + if [ $? -ne 0 ]; then + return + fi + ;; *) echo "unhandled item in kdump target checklist" return
We can easily achieve this by adding "lvm" in the checklist. We need do this, because in case of "nfs" dumping, if "lvm" is added, the lvm2 under kdump still operates the lvm volume due to the "rd.lvm.lv=X" inherited from the first kernel.
This patch removes "lvm" from the kdump initramfs in case of no lvm target, it can reduce several megabytes from initramfs.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- mkdumprd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 38b3f12..4eb0dea 100644 --- a/mkdumprd +++ b/mkdumprd @@ -12,7 +12,7 @@ export IN_KDUMP=1
# See kdump_target_XXX() -KDUMP_TARGET_CHECKLIST="lvmlinear" +KDUMP_TARGET_CHECKLIST="lvm lvmlinear"
conf_file="/etc/kdump.conf" SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa" @@ -297,6 +297,11 @@ kdump_target_handle() tag=KDUMP_TARGET_TAG_$item # the item handling begins case "$item" in + lvm) + if ! [[ $pdev =~ "/dev/mapper/" ]]; then + return + fi + ;; lvmlinear) if ! [[ $pdev =~ "/dev/mapper/" ]]; then return @@ -596,6 +601,11 @@ then add_dracut_arg "--add-drivers" "$extra_modules" fi
+# Omit "lvm" dracut module if we have no lvm target. +if ! kdump_target_check lvm ; then + add_dracut_arg "-o" "lvm" +fi + dracut "${dracut_args[@]}" "$@" _rc=$? sync
On 03/23/2017 at 04:47 PM, Xunlei Pang wrote:
We add a generic dump target hook for kdump, supposed to monitor all the devices mounted by kdump.
PATCH6 implements the basic framework, add a hook kdump_target_hook(), and provide a generic helper kdump_target_check() for use(must use it under mkdump/dracut).
The first five patches are prerequisites for the mechanism, this will ensure us only have one device(our dump target) mounted after kdump boot, there still are corner cases like the special "x-initrd.mount" in /etc/fstab, we can discuss it further to see if we should mount it by kdump or handle it?
Did some tests, it is just recognized as host_devs[] by dracut, seems not adding the mount information. Checked under kdump, /etc/fstab does not contain the line as that in first kernel. So this should not be a problem.
Regards, Xunlei
PATCH7 is an application of this mechanism(add the "lvm_linear" checklist), if the dump target is linear type lvm volume, we reduce the "reserved_memory" in "/etc/lvm/lvm.conf" from 8MB to 1MB(we discussed this with lvm team, they agree that we can safely set it to 1MB in case of only one lvm linear target).
PATCH8 is another application(add the "lvm" checklist) to remove "lvm" dracut module when no lvm target needed by kdump.
Xunlei Pang (8): kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot kdumpctl: fix the rebuild issue after removing "root=X" Revert "kdumpctl: filter 'root' kernel parameter when running in live images" kdumpctl: move is_fadump_capable() into kdump-lib.sh mkdumprd: add a generic hook for the dump target mkdumprd: reduce lvm2 memory in case of linear volume mkdumprd: omit "lvm" dracut module if no lvm target
dracut-module-setup.sh | 6 +++ dracut-process-lvmconf.sh | 6 +++ kdump-lib.sh | 25 +++++++++ kdumpctl | 36 +++++-------- kexec-tools.spec | 3 ++ mkdumprd | 128 +++++++++++++++++++++++++++++++++++++++------- 6 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 dracut-process-lvmconf.sh
On 03/23/17 at 04:47pm, Xunlei Pang wrote:
We add a generic dump target hook for kdump, supposed to monitor all the devices mounted by kdump.
PATCH6 implements the basic framework, add a hook kdump_target_hook(), and provide a generic helper kdump_target_check() for use(must use it under mkdump/dracut).
The first five patches are prerequisites for the mechanism, this will ensure us only have one device(our dump target) mounted after kdump boot, there still are corner cases like the special "x-initrd.mount" in /etc/fstab, we can discuss it further to see if we should mount it by kdump or handle it?
PATCH7 is an application of this mechanism(add the "lvm_linear" checklist), if the dump target is linear type lvm volume, we reduce the "reserved_memory" in "/etc/lvm/lvm.conf" from 8MB to 1MB(we discussed this with lvm team, they agree that we can safely set it to 1MB in case of only one lvm linear target).
PATCH8 is another application(add the "lvm" checklist) to remove "lvm" dracut module when no lvm target needed by kdump.
Xunlei Pang (8): kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot kdumpctl: fix the rebuild issue after removing "root=X" Revert "kdumpctl: filter 'root' kernel parameter when running in live images" kdumpctl: move is_fadump_capable() into kdump-lib.sh mkdumprd: add a generic hook for the dump target mkdumprd: reduce lvm2 memory in case of linear volume mkdumprd: omit "lvm" dracut module if no lvm target
dracut-module-setup.sh | 6 +++ dracut-process-lvmconf.sh | 6 +++ kdump-lib.sh | 25 +++++++++ kdumpctl | 36 +++++-------- kexec-tools.spec | 3 ++ mkdumprd | 128 +++++++++++++++++++++++++++++++++++++++------- 6 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 dracut-process-lvmconf.sh
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Hi, Xunlei
Have not finished read all the patches, but seem this series is doing two things, one is remove root dependencies, another is shrink lvm memory usage. How about split them into two series. We can review them separately considering the lvm part is a little complicated.
BTW, seems patch 2 and patch 3 can be merged in one patch.
Thanks Dave
On 03/24/2017 at 04:27 PM, Dave Young wrote:
On 03/23/17 at 04:47pm, Xunlei Pang wrote:
We add a generic dump target hook for kdump, supposed to monitor all the devices mounted by kdump.
PATCH6 implements the basic framework, add a hook kdump_target_hook(), and provide a generic helper kdump_target_check() for use(must use it under mkdump/dracut).
The first five patches are prerequisites for the mechanism, this will ensure us only have one device(our dump target) mounted after kdump boot, there still are corner cases like the special "x-initrd.mount" in /etc/fstab, we can discuss it further to see if we should mount it by kdump or handle it?
PATCH7 is an application of this mechanism(add the "lvm_linear" checklist), if the dump target is linear type lvm volume, we reduce the "reserved_memory" in "/etc/lvm/lvm.conf" from 8MB to 1MB(we discussed this with lvm team, they agree that we can safely set it to 1MB in case of only one lvm linear target).
PATCH8 is another application(add the "lvm" checklist) to remove "lvm" dracut module when no lvm target needed by kdump.
Xunlei Pang (8): kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot kdumpctl: fix the rebuild issue after removing "root=X" Revert "kdumpctl: filter 'root' kernel parameter when running in live images" kdumpctl: move is_fadump_capable() into kdump-lib.sh mkdumprd: add a generic hook for the dump target mkdumprd: reduce lvm2 memory in case of linear volume mkdumprd: omit "lvm" dracut module if no lvm target
dracut-module-setup.sh | 6 +++ dracut-process-lvmconf.sh | 6 +++ kdump-lib.sh | 25 +++++++++ kdumpctl | 36 +++++-------- kexec-tools.spec | 3 ++ mkdumprd | 128 +++++++++++++++++++++++++++++++++++++++------- 6 files changed, 163 insertions(+), 41 deletions(-) create mode 100644 dracut-process-lvmconf.sh
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Hi, Xunlei
Have not finished read all the patches, but seem this series is doing two things, one is remove root dependencies, another is shrink lvm memory usage. How about split them into two series. We can review them separately considering the lvm part is a little complicated.
Hi Dave,
Thanks for your comment.
Yes, they are two things. But "lvm" patches rely on "remove root dependencies" which ensures that we only have one target, but it is a little hard. As I replied the "x-initrd.mount", it's actually related(host_devs[] doesn't need to be mounted, but still may be a lvm volue).
In other words, we have to make sure that all the host devices added to kdump are hooked. For example, in case of nfs dumping, the current implementation still has root, it the root is lvm volume as it normally is, we will have a wrong judgment. For this point, I guess I can try to add an extra hook for the root device to split it into two series.
BTW, seems patch 2 and patch 3 can be merged in one patch.
Yes, can be merged.
Regards, Xunlei