-
Notifications
You must be signed in to change notification settings - Fork 78
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
btrfs-defrag-plugin: Check fragmentation level before filling up disk #43
Comments
The defrag in kernel will check if the extent size is smaller than the desired size (which is 32MiB as set by the plugin) so the reflink breaking should not happen for the large extents. |
|
So the target size of 64M (I was mistaken about 32M, that was default of |
I've checked one of my rolling distro installations where the system gets updated frequently and the rpm database is usually fragmented. There were way more fragments of all sizes. The post-update defragmentation was able to suqeeze the whole file to larger blocks. So I think the fragmentation itself is not enough to determine if the defragmentation should be done or not. Changing the target extent size to 32M could produce a similar result so I don't think this would make the situation worse in the above case. |
The RPM database becomes fragmented in any case and the free space tends to be fragmented as well over time, so the 64MB target is too ambitious. Besides the fragmentation itself, the shared extents caused by snapshotting of the underlying subvolume will become unshared after defragmentation. This will consume more space so the lower target will also possibly reduce the unsharing. We'd need a better extent analysis, the defrag still seems too rough. Issue: #43 Signed-off-by: David Sterba <dsterba@suse.com>
I'm going to set the target size to 32MiB and keep the issue open as the extent analysis is a better solution. |
The defragmentation is run unconditionally, even if the majority of extens is still large, e.g.:
` /usr/sbin/filefrag -v /usr/lib/sysimage/rpm/Packages
This is after installing a single package, with deactivated defrag plugin
Defragmentation causes high disk usage (man btrfs-filesystem):
The text was updated successfully, but these errors were encountered: