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

Allow setting zstd compression level with btrfs defrag #184

Open
ghost opened this issue Jun 20, 2019 · 10 comments
Open

Allow setting zstd compression level with btrfs defrag #184

ghost opened this issue Jun 20, 2019 · 10 comments

Comments

@ghost
Copy link

@ghost ghost commented Jun 20, 2019

Currently btrfs defrag -c zstd uses a fixed compression level. It would be useful to be able to set it manually. The same way we can in mount options. zstd:1-15.

Thanks.

@denharad
Copy link

@denharad denharad commented Jun 29, 2019

This would be great for forcing greater compression on large static files without archiving them.

@ghost
Copy link
Author

@ghost ghost commented Jun 29, 2019

This is my thinking. Stale files could be compressed higher without much loss of performance in case they need to be accessed. There are other use-cases too, I'm sure.

@kdave
Copy link
Owner

@kdave kdave commented Jul 2, 2019

This needs enhancement of the ioctl interface, there's space in the data structure to specify the level but it needs to be properly handled in kernel.

@kdave kdave added the enhancement label Jul 23, 2019
@qwerty123443
Copy link

@qwerty123443 qwerty123443 commented Jan 2, 2020

Is this being worked on? Otherwise I'd like to attempt to implement this

@qwerty123443
Copy link

@qwerty123443 qwerty123443 commented Jan 4, 2020

As visible above, the code is now written. I have no clue if i'm putting the pull request in the right place so please let me know if I should rebase or merge into another repo

@jamadazi
Copy link

@jamadazi jamadazi commented Feb 27, 2020

Any progress on this? AFAIK kernel (and hence, btrfs) development does not typically happen through GitHub. What would it take for the patches from the above pull requests to be merged into upstream?

@marcosps
Copy link
Contributor

@marcosps marcosps commented Feb 28, 2020

@qwerty123443 I believe it would be better if you could send the patches through the mailing list :)

@qwerty123443
Copy link

@qwerty123443 qwerty123443 commented Mar 3, 2020

Ah yes, I've kind of forgotten about this. I'll take a look at the mailing list soon (tm). There is still some refinement to be done and at the moment I do not have the time to fix it up properly. For anyone reading this: feel free to use the code I've written and change it + submit it to the linux/btrfs mailing list

@kdave kdave added the kernel label Apr 8, 2020
@RubenKelevra
Copy link

@RubenKelevra RubenKelevra commented Apr 11, 2020

I was wondering why the compression level is capped at 15 for zstd. They actually go up to 22 (when ultra is on).

Would be nice to be able to compress files with more effort, if you don't bother about the speed.

@qwerty123443
Copy link

@qwerty123443 qwerty123443 commented Apr 12, 2020

I've submitted a patch to the mailing list, and I hope it'll be merged soon.
@RubenKelevra It's been a while since I've looked in to it, but if I recall correctly, the kernel does not support levels higher than 15 because of the way the workspaces are (were?) set up. Definately not sure about this one though.

The patch can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
@RubenKelevra @marcosps @kdave @qwerty123443 @denharad @jamadazi and others
You can’t perform that action at this time.