There are some complaints about nfs kdump that users must mount nfs beforehand, which may cause some overhead to nfs server. For example, there're thounsands of clients deployed with kdump diskless boot, each time the client is boot up, it will trigger kdump rebuilding so will mount nfs, thus resulting in thousands of nfs request concurrently imposed on the same nfs server.
We introduce a new way of specifying mount information via the already-existent "dracut_args" directive, we will skip all the filesystem mounting and checking things for it. So it can be used in the above-mentioned nfs scenario and avoid creating severe nfs server overhead.
Specifically, if there is any "--mount" information specifed via "dracut_args" in /etc/kdump.conf, always use it as the final mount without any check(users are expected to ensure its correctness), it overrides any target specified in /etc/kdump.conf, as an example: dracut_args --mount '/dev/mapper/test /tmp/test ext2 defaults,x-initrd.mount' (dracut will create <mountpoint> if not existent in kdump kernel)
Suggested-by: Dave Young dyoung@redhat.com Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdump-lib.sh | 9 +++++++++ kdumpctl | 5 +++++ mkdumprd | 8 ++++++++ 3 files changed, 22 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh index fc2c036..b930e1c 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -279,3 +279,12 @@ is_hostname() fi echo $1 | grep -q "[a-zA-Z]" } + +# If "dracut_args" contains "--mount" information, use it +# directly without any check(users are expected to ensure +# its correctness). It overrides any target specified in +# /etc/kdump.conf. +dracut_args_contains_mount() +{ + return $(grep ^dracut_args /etc/kdump.conf | grep -q "--mount") +} diff --git a/kdumpctl b/kdumpctl index fcc9ad0..4ed6282 100755 --- a/kdumpctl +++ b/kdumpctl @@ -365,6 +365,11 @@ check_dump_fs_modified() local _new_dev _new_mntpoint _new_fstype local _target _path _dracut_args
+ # No need to check in case of mount target specified via "dracut_args". + if dracut_args_contains_mount; then + return 0 + fi + # No need to check in case of raw target. # Currently we do not check also if ssh/nfs target is specified if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then diff --git a/mkdumprd b/mkdumprd index 78afb1a..8110f24 100644 --- a/mkdumprd +++ b/mkdumprd @@ -497,6 +497,14 @@ do extra_modules="$extra_modules $config_val" ;; ext[234]|xfs|btrfs|minix|nfs) + # Use the mount information in "dracut_args", skip further parsing. + if dracut_args_contains_mount; then + if [ "$config_opt" = "nfs" ]; then + add_dracut_module "nfs" + fi + continue + fi + if ! findmnt $config_val >/dev/null; then perror_exit "Dump target $config_val is probably not mounted." fi
On 2016/05/18 at 15:58, Xunlei Pang wrote:
There are some complaints about nfs kdump that users must mount nfs beforehand, which may cause some overhead to nfs server. For example, there're thounsands of clients deployed with kdump diskless boot, each time the client is boot up, it will trigger kdump rebuilding so will mount nfs, thus resulting in thousands of nfs request concurrently imposed on the same nfs server.
We introduce a new way of specifying mount information via the already-existent "dracut_args" directive, we will skip all the filesystem mounting and checking things for it. So it can be used in the above-mentioned nfs scenario and avoid creating severe nfs server overhead.
Specifically, if there is any "--mount" information specifed via "dracut_args" in /etc/kdump.conf, always use it as the final mount without any check(users are expected to ensure its correctness), it overrides any target specified in /etc/kdump.conf, as an example: dracut_args --mount '/dev/mapper/test /tmp/test ext2 defaults,x-initrd.mount' (dracut will create <mountpoint> if not existent in kdump kernel)
Suggested-by: Dave Young dyoung@redhat.com Signed-off-by: Xunlei Pang xlpang@redhat.com
kdump-lib.sh | 9 +++++++++ kdumpctl | 5 +++++ mkdumprd | 8 ++++++++ 3 files changed, 22 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh index fc2c036..b930e1c 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -279,3 +279,12 @@ is_hostname() fi echo $1 | grep -q "[a-zA-Z]" }
+# If "dracut_args" contains "--mount" information, use it +# directly without any check(users are expected to ensure +# its correctness). It overrides any target specified in +# /etc/kdump.conf. +dracut_args_contains_mount() +{
- return $(grep ^dracut_args /etc/kdump.conf | grep -q "--mount")
+} diff --git a/kdumpctl b/kdumpctl index fcc9ad0..4ed6282 100755 --- a/kdumpctl +++ b/kdumpctl @@ -365,6 +365,11 @@ check_dump_fs_modified() local _new_dev _new_mntpoint _new_fstype local _target _path _dracut_args
- # No need to check in case of mount target specified via "dracut_args".
- if dracut_args_contains_mount; then
return 0
- fi
- # No need to check in case of raw target. # Currently we do not check also if ssh/nfs target is specified if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then
diff --git a/mkdumprd b/mkdumprd index 78afb1a..8110f24 100644 --- a/mkdumprd +++ b/mkdumprd @@ -497,6 +497,14 @@ do extra_modules="$extra_modules $config_val" ;; ext[234]|xfs|btrfs|minix|nfs)
# Use the mount information in "dracut_args", skip further parsing.
if dracut_args_contains_mount; then
if [ "$config_opt" = "nfs" ]; then
add_dracut_module "nfs"
fi
continue
fi
Oops, forgot to handle "handle_default_dump_target", will improve later.
Regards, Xunlei
if ! findmnt $config_val >/dev/null; then perror_exit "Dump target $config_val is probably not mounted." fi