10000 mkdumprd: replace lz4hc with lzma for better compression in squash image by licliu · Pull Request #87 · rhkdump/kdump-utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mkdumprd: replace lz4hc with lzma for better compression in squash image #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

licliu
Copy link
Collaborator
@licliu licliu commented May 27, 2025

Among the compression algorithms currently enabled in RHEL-10, erofs+lzma has a higher compression ratio than lz4hc, this patch will replace it with lzma.

Testing shows when using erofs+lz4hc in RHEL-10, the size of the initramfs generated for local dump is 47M, and the size for nfs dump is 57M. After using lzma, the size is reduced to 39M and 45M. This is very closely compared to the 38M and 44M when using squashfs+zstd.

Summary by Sourcery

Replace LZ4HC with LZMA for EROFS compression in mkdumprd to reduce squash image sizes

Enhancements:

  • Switch EROFS compression algorithm from lz4hc to lzma in mkdumprd

Documentation:

  • Update script comments and usage text to reference lzma instead of lz4hc

Among the compression algorithms currently enabled in RHEL-10,
erofs+lzma has a higher compression ratio than lz4hc, this patch
will replace it with lzma.

Testing shows when using erofs+lz4hc in RHEL-10, the size of the
initramfs generated for local dump is 47M, and the size for nfs
dump is 57M. After using lzma, the size is reduced to 39M and 45M.
This is very closely compared to the 38M and 44M when using
squashfs+zstd.

Signed-off-by: Lichen Liu <lichliu@redhat.com>
Copy link
sourcery-ai bot commented May 27, 2025

Reviewer's Guide

This PR updates the mkdumprd script to switch the default squash image compression from lz4hc to lzma, updating the command invocations, option parsing, and help text accordingly to achieve better compression ratios on RHEL-10.

File-Level Changes

Change Details Files
Swapped default compression algorithm from lz4hc to lzma
  • Replaced ‘lz4hc’ flag with ‘lzma’ in compression command
  • Updated default compression variable to lzma
  • Modified option parsing to recognize lzma instead of lz4hc
mkdumprd
Updated help and usage documentation for new compression option
  • Changed help text to reference lzma instead of lz4hc
  • Adjusted usage examples to show --compress=lzma
mkdumprd

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @licliu - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@hsiangkao
Copy link
hsiangkao commented May 27, 2025

Hi @licliu, according to https://issues.redhat.com/browse/RHEL-36444, it seems erofs+lzma will be smaller than squashfs+zstd and I've applied -C65536 to dracut as in dracut-ng/dracut-ng#1296 (assuming that you already use the commit I submitted..)

So what's the difference here? In principle, lzma should have smaller image size than zstd.

@Barathrum-Liu
Copy link
Collaborator

Hi @hsiangkao, thanks for your attention!
Yes you are right, if we apply dracut-ng/dracut-ng#1296 it will be smaller image size than zstd. But currently that patch is not back-ported to RHEL-10.
I have created a ticket to dracut team for this patch.

@hsiangkao
Copy link

Hi @hsiangkao, thanks for your attention! Yes you are right, if we apply dracut-ng/dracut-ng#1296 it will be smaller image size than zstd. But currently that patch is not back-ported to RHEL-10. I have created a ticket to dracut team for this patch.

I do think the kdump use case doesn't need -C4096 as Android, so -C65536 will be useful for you to get even smaller images.

@coiby coiby merged commit 1d40ea3 into rhkdump:main Jun 4, 2025
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0