-
Notifications
You must be signed in to change notification settings - Fork 157
btrfs recalim on kernel v5.19+: use bg_reclaim_threshold #2091
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 recalim on kernel v5.19+: use bg_reclaim_threshold #2091
Conversation
Hi @motiejus. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a minor nit.
edc5a0a
to
df6a569
Compare
/retest Looks like VM failed to come up for e2e test, this is probably a flake. |
@motiejus: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
I noticed the commit has Before I fix that and force-push, is there anything more that needs to be addressed? |
Hmm, it seems the linter is unhappy with the commit message, not the PR, but I can't figure out why. Anyway /lgtm thank you! I'll try to keep watch & re-lgtm if you have to force push something. Ping me if I'm slow. |
There is a failing Windows check — should I try to force-push and hope it's a flake that will self-resolve, or you will do something on your end? Just checking about the next steps. |
I can force merge if necessary. Can you try to clear the invalid commit message first? |
Add a sysfs knob `btrfs-allocation-{,meta}data-bg_reclaim_threshold`, which will do the equivalent of: ``` echo VALUE > /sys/fs/btrfs/FS-UUID/allocation/data/bg_reclaim_threshold ``` Or, in case of metadata, equivalently: ``` echo VALUE > /sys/fs/btrfs/FS-UUID/allocation/metadata/bg_reclaim_threshold ``` Where VALUE is a number between `0` and `99` inclusive. Adding it as a "special" mount option, similarly to `read_ahead_kb`, as that's quite convenient. Some resources about `bg_reclaim_threshold` and more broadly balancing of the btrfs filesystem: - https://btrfs.readthedocs.io/en/latest/Administration.html#uuid-allocations-data-metadata-system - https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18bb8bbf13c1839b43c9e09e76d397b753989af2 - https://lwn.net/Articles/978826/ Linux v6.11+, this may obsolete `bg_reclaim_threshold`. Author's interpretation ----------------------- The higher the reclaim threshold, the more accurately btrfs will show unused space (`Device Unallocated` row of `btrfs filesystem usage`) at the expense of sometimes needlessly moving data around. The lower the threshold, the less rebalancing, the less accurate metrics of the remaining space. The author of this commit prefers more IO in order to see more accurate `Device Unallocated` metrics, and therefore sets `btrfs-allocation-data-bg_reclaim_threshold=90`.
df6a569
to
7f44bae
Compare
Ah, sure, done. Please kick off the tests, hopefully all will pass this time 🤞
This one's weird, I only changed the commit message (removed
|
/ok-to-test |
Who can question the wisdom of github AI overlords? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattcary, motiejus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add a sysfs knob
btrfs-allocation-{,meta}data-bg_reclaim_threshold
, which will do the equivalent of:Or, in case of metadata, equivalently:
Where VALUE is a number between
0
and99
inclusive.Adding it as a "special" mount option, similarly to
read_ahead_kb
, as that's quite convenient.Some resources about
bg_reclaim_threshold
and more broadly balancing of the btrfs filesystem:bg_reclaim_threshold
.Author's interpretation
The higher the reclaim threshold, the more accurately btrfs will show unused space (
Device Unallocated
row ofbtrfs filesystem usage
) at the expense of sometimes needlessly moving data around. The lower the threshold, the less rebalancing, the less accurate metrics of the remaining space.The author of this commit prefers more IO in order to see more accurate
Device Unallocated
metrics, and therefore setsbtrfs-allocation-data-bg_reclaim_threshold=90
.What type of PR is this?
/kind feature
What this PR does / why we need it:
More control to the operator to manage btrfs free space tracking.
Which issue(s) this PR fixes:
Fixes #2088
Does this PR introduce a user-facing change?: