zstd has better compression ratio and time consumption balance than zlib/lzo/snappy. When no customized compression method specified in kdump.conf, we will use zstd as the default compression method.
v1 -> v2: Use kdump_get_conf_val() to get dracut_args values of kdump.conf
Signed-off-by: Tao Liu ltao@redhat.com --- kdump-lib.sh | 6 ++++++ mkdumprd | 4 ++++ mkfadumprd | 4 ++++ 3 files changed, 14 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh index e435498..e374c71 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -443,6 +443,12 @@ is_wdt_active() return 1 }
+have_compression_in_dracut_args() +{ + [[ " $(kdump_get_conf_val dracut_args)" =~ \ + .*[[:space:]]--(gzip|bzip2|lzma|xz|lzo|lz4|zstd|no-compress|compress)([[:space:]]|$) ]] +} + # If "dracut_args" contains "--mount" information, use it # directly without any check(users are expected to ensure # its correctness). diff --git a/mkdumprd b/mkdumprd index d87d588..9c26ecc 100644 --- a/mkdumprd +++ b/mkdumprd @@ -431,6 +431,10 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
+if ! have_compression_in_dracut_args; then + add_dracut_arg "--compress" "zstd" +fi + if [[ -n $extra_modules ]]; then add_dracut_arg "--add-drivers" "$extra_modules" fi diff --git a/mkfadumprd b/mkfadumprd index b890f83..16fdacc 100644 --- a/mkfadumprd +++ b/mkfadumprd @@ -62,6 +62,10 @@ if is_squash_available; then _dracut_isolate_args+=(--add squash) fi
+if ! have_compression_in_dracut_args; then + _dracut_isolate_args+=(--compress zstd) +fi + if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability" fi
Hi Tao,
On Tue, Dec 21, 2021 at 11:08:26AM +0800, Tao Liu wrote:
zstd has better compression ratio and time consumption balance than zlib/lzo/snappy. When no customized compression method specified in kdump.conf, we will use zstd as the default compression method.
Could you also include the benchmark data in the commit message?
v1 -> v2: Use kdump_get_conf_val() to get dracut_args values of kdump.conf
Signed-off-by: Tao Liu ltao@redhat.com
kdump-lib.sh | 6 ++++++ mkdumprd | 4 ++++ mkfadumprd | 4 ++++ 3 files changed, 14 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh index e435498..e374c71 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -443,6 +443,12 @@ is_wdt_active() return 1 }
+have_compression_in_dracut_args() +{
- [[ " $(kdump_get_conf_val dracut_args)" =~ \
.*[[:space:]]--(gzip|bzip2|lzma|xz|lzo|lz4|zstd|no-compress|compress)([[:space:]]|$) ]]
+}
# If "dracut_args" contains "--mount" information, use it # directly without any check(users are expected to ensure # its correctness). diff --git a/mkdumprd b/mkdumprd index d87d588..9c26ecc 100644 --- a/mkdumprd +++ b/mkdumprd @@ -431,6 +431,10 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
+if ! have_compression_in_dracut_args; then
- add_dracut_arg "--compress" "zstd"
+fi
if [[ -n $extra_modules ]]; then add_dracut_arg "--add-drivers" "$extra_modules" fi diff --git a/mkfadumprd b/mkfadumprd index b890f83..16fdacc 100644 --- a/mkfadumprd +++ b/mkfadumprd @@ -62,6 +62,10 @@ if is_squash_available; then _dracut_isolate_args+=(--add squash) fi
+if ! have_compression_in_dracut_args; then
- _dracut_isolate_args+=(--compress zstd)
+fi
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability" fi -- 2.33.1
Hi Coiby,
On Thu, Dec 23, 2021 at 3:50 PM Coiby Xu coxu@redhat.com wrote:
Hi Tao,
On Tue, Dec 21, 2021 at 11:08:26AM +0800, Tao Liu wrote:
zstd has better compression ratio and time consumption balance than zlib/lzo/snappy. When no customized compression method specified in kdump.conf, we will use zstd as the default compression method.
Could you also include the benchmark data in the commit message?
Thanks for the comments, I'll put the benchmark in the v3 patch commits.
Thanks, Tao Liu
v1 -> v2: Use kdump_get_conf_val() to get dracut_args values of kdump.conf
Signed-off-by: Tao Liu ltao@redhat.com
kdump-lib.sh | 6 ++++++ mkdumprd | 4 ++++ mkfadumprd | 4 ++++ 3 files changed, 14 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh index e435498..e374c71 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -443,6 +443,12 @@ is_wdt_active() return 1 }
+have_compression_in_dracut_args() +{
[[ " $(kdump_get_conf_val dracut_args)" =~ \
.*[[:space:]]--(gzip|bzip2|lzma|xz|lzo|lz4|zstd|no-compress|compress)([[:space:]]|$) ]]
+}
# If "dracut_args" contains "--mount" information, use it # directly without any check(users are expected to ensure # its correctness). diff --git a/mkdumprd b/mkdumprd index d87d588..9c26ecc 100644 --- a/mkdumprd +++ b/mkdumprd @@ -431,6 +431,10 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
+if ! have_compression_in_dracut_args; then
add_dracut_arg "--compress" "zstd"
+fi
if [[ -n $extra_modules ]]; then add_dracut_arg "--add-drivers" "$extra_modules" fi diff --git a/mkfadumprd b/mkfadumprd index b890f83..16fdacc 100644 --- a/mkfadumprd +++ b/mkfadumprd @@ -62,6 +62,10 @@ if is_squash_available; then _dracut_isolate_args+=(--add squash) fi
+if ! have_compression_in_dracut_args; then
_dracut_isolate_args+=(--compress zstd)
+fi
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability" fi -- 2.33.1
-- Best regards, Coiby