Skip to content
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

udev: Add ZRAM recompression by default #13

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

ventureoo
Copy link
Member

Since we already have CONFIG_ZRAM_MULTI_COMP enabled in our kernel, I thought that we could provide by default recompressions to ZRAM. Double compression will save more memory for those pages that cannot be compressed with Zstd (since we use it by default), in this PR I decided to set double compression only for idle pages, since huge pages were reverted with the commit 48f40a5. The re-compression algorithm can be changed in the future, for now I stopped at LZ4.

This was done as a udev rule as a temporary solution, since it is better to have this feature directly in the zram-generator, but until it is absent we will limit ourselves to this rule.

It also works only for kernel versions 6.2 and higher, for versions of the kernel below this should not create due to the checks (I tested at linux-zen 6.1, no errors).

Note: I know that recompression may cause additional CPU overhead, but I don't think it will be too critical. Additionally, we can limit this via the threshold parameter. Anyway, it's interesting to hear your opinion @sirlucjan @ptr1337

Works only for kernel versions 6.2 and higher.
For versions of the kernel below this should not create due to the checks.
@ptr1337
Copy link
Member

ptr1337 commented Feb 26, 2023

I need to test this first.
@ventureoo How your testing was ? Did something improved at your side?

@sirlucjan
Copy link
Member

I'll test it tomorrow.

Copy link
Member

@sirlucjan sirlucjan left a comment

Choose a reason for hiding this comment

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

I didn't notice regressions.

@ptr1337 ptr1337 merged commit bb899fb into CachyOS:master Mar 4, 2023
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.

3 participants