[btrfs] add btrfs-specific bdi/read_ahead_kb#2156
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. DetailsInstructions 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. |
Add a knob for the btrfs-specific `bdi/read_ahead_kb`. If my understanding is correct, this value is the upper limit of the btrfs read-ahead of the _underlying file_. Confusingly, this option is not related to `/sys/block/sdX/queue/read_ahead_kb`, which is what controls the read-ahead of the block device (regardless of what's in there). The current `read_ahead_kb` "special" mount option configures the value of the block device. The default `bdi/read_ahead_kb` is 4MiB (on all the systems I've checked). Ext4 does not have this option and relies on the block-device specific readahead, which is 128KiB (again, on all the systems I've checked). After migrating to btrfs we have experienced a notable write amplification and tracked to this setting. Once we changed `bdi/read_ahead_kb` to 128, our IO utilization (and the properties of the underlying workload) became very similar to the one of ext4. Now that we have 3 btrfs-specific "special" mount options, I refactored the code and tests to make it less repetitive.
2493129 to
f6c8051
Compare
|
/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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@motiejus: The following tests 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. DetailsInstructions 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. |
Add a knob for the btrfs-specific
bdi/read_ahead_kb. AFAIK this value is the upper limit of the btrfs read-ahead of the underlying file.What type of PR is this?
/kind feature
What this PR does / why we need it:
Confusingly, this option is not related to
/sys/block/sdX/queue/read_ahead_kb, which is what controls the read-ahead of the block device (regardless of what's in there). The currentread_ahead_kb"special" mount option configures the value of the block device.The default
bdi/read_ahead_kbis 4MiB (on all the systems I've checked). Ext4 does not have this option and relies on the block-device specific readahead, which is 128KiB (again, on all the systems I've checked). After migrating to btrfs we have experienced a notable read amplification and tracked to this setting. Once we changedbdi/read_ahead_kbto 128, our IO utilization (and the properties of the underlying workload) became very similar to the one of ext4.Which issue(s) this PR fixes:
Fixes #2155
Special notes for your reviewer:
Now that we have 3 btrfs-specific "special" mount options, I refactored the code and tests to make it less repetitive.
Does this PR introduce a user-facing change?: