Hi Coiby,
On Thu, Jan 6, 2022 at 8:30 AM Coiby Xu <coxu(a)redhat.com> wrote:
Thanks for the patch!
Acked-by: Coiby Xu <coxu(a)redhat.com>
Thanks for reviewing the patch!
Thanks,
Tao Liu
On Wed, Jan 05, 2022 at 05:42:12PM +0800, Tao Liu wrote:
>zstd has better compression ratio and time consumption balance.
>When no customized compression method specified in kdump.conf,
>we will use zstd as the default compression method.
>
>**The test method:
>
>I installed kexec-tools with and without the patch, executing the following
>command for 4 times, and calculate the averange time:
>
>$ rm -f /boot/initramfs-*kdump.img && time kdumpctl rebuild && \
> ls -ail /boot/initramfs-*kdump.img
>
>**The test result:
>
>Bare metal x86_64 machine:
> dracut with squash module
> zlib lzo xz lz4 zstd
>real 10.6282 11.0398 11.395 8.6424 10.1676
>user 9.8932 11.9072 14.2304 2.8286 8.6468
>sys 3.523 3.4626 3.6028 3.5 3.4942
>size of
>kdump.img 30575616 31419392 27102208 36666368 29236224
>
> dracut without squash module
> zlib lzo xz lz4 zstd
>real 9.509 19.4876 11.6724 9.0338 10.267
>user 10.6028 14.516 17.8662 4.0476 9.0936
>sys 2.942 2.9184 3.0662 2.9232 3.0662
>size of
>kdump.img 19247949 19958120 14505056 21112544 17007764
>
>PowerVM hosted ppc64le VM:
> dracut with squash module | dracut without sqaush module
> zlib zstd | zlib zstd
>real 10.6742 10.7572 | 9.7676 10.5722
>user 18.754 19.8338 | 20.7932 13.179
>sys 1.8358 1.864 | 1.637 1.663
> |
>size of |
>kdump.img 36917248 35467264 | 21441323 19007108
>
>**discussion
>
>zstd has a better compression ratio and time consumption balance.
>
>v1 -> v2:
>Use kdump_get_conf_val() to get dracut_args values of kdump.conf
>
>v2 -> v3:
>Attached testing benchmark
>
>v3 -> v4:
>Re-measured and re-attached the testing benchmark of x86_64 and ppc64le.
>Changed regex '.*[[:space:]]' to '(^|[[:space:]])'
>
>v4 -> v5:
>Attacked lzo/xz/lz4 testing benchmark.
>
>v5 -> v6:
>Add zstd as required in kexec-tools.spec
>
>Hello Coiby, you may use "RELEASE=34 make test-run", for
>CONFIG_RD_ZSTD is enabled since fc-cloud-34
>
>Signed-off-by: Tao Liu <ltao(a)redhat.com>
>---
> kdump-lib.sh | 6 ++++++
> kexec-tools.spec | 1 +
> mkdumprd | 4 ++++
> mkfadumprd | 4 ++++
> 4 files changed, 15 insertions(+)
>
>diff --git a/kdump-lib.sh b/kdump-lib.sh
>index 2e2775c..77db71a 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/kexec-tools.spec b/kexec-tools.spec
>index ab7f41f..0c6b60f 100644
>--- a/kexec-tools.spec
>+++ b/kexec-tools.spec
>@@ -70,6 +70,7 @@ Requires: dracut >= 050
> Requires: dracut-network >= 050
> Requires: dracut-squash >= 050
> Requires: ethtool
>+Requires: zstd
> Recommends: grubby
> BuildRequires: make
> BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison
flex lzo-devel snappy-devel libzstd-devel
>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