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

RFE: Online thin_trim #211

Open
DemiMarie opened this issue May 2, 2022 · 2 comments
Open

RFE: Online thin_trim #211

DemiMarie opened this issue May 2, 2022 · 2 comments

Comments

@DemiMarie
Copy link

thin_trim currently needs to run offline, which is quite inconvienent. It would be much more convienent if thin_trim could be used online.

@mingnus
Copy link
Collaborator

mingnus commented May 3, 2022

it's the limitation of the tool and dm-thin. Unlike fstrim, thin_trim performs discard from userland, and the dm-thin driver does not lock unused data blocks during the process. That's why thin_trim requires the pool to be offline.

An (inefficient) workaround might be, create a new volume that occupies the amount of free space you'd like to discard in the pool, then discard the whole volume to passdown the trim commands to the pool data device. However, this approach results in unnecessary writes due to the allocations, although we don't have to write the whole data block.

@DemiMarie
Copy link
Author

it's the limitation of the tool and dm-thin. Unlike fstrim, thin_trim performs discard from userland, and the dm-thin driver does not lock unused data blocks during the process. That's why thin_trim requires the pool to be offline.

Could this be fixed in dm-thin?

An (inefficient) workaround might be, create a new volume that occupies the amount of free space you'd like to discard in the pool, then discard the whole volume to passdown the trim commands to the pool data device. However, this approach results in unnecessary writes due to the allocations, although we don't have to write the whole data block.

Another approach might be to suspend the entire pool while the discard operation happens.

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

No branches or pull requests

2 participants