-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add prefetch property #15237
add prefetch property #15237
Conversation
df270ba
to
0c75753
Compare
What's with backward compatibility - i.e. import pool with such defined property with pre-patch code? |
Good question. An unpatched ZFS seems to have no issue importing and using the pool - the
|
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.
I have no objections besides minor comments above and the fact that I don't like manual tuning for things that should behave out of the box. From time to time I think if we could properly wire POSIX fadvise API to allow applications to control prefetch.
I wonder, do you have particular workloads where prefetcher is hurting? Can prefetcher be improved to handle them better?
Yeah, adding
To tell the truth, no, it always worked well for me (or at least not so bad I noticed). However, it seems others have issues with it (see #15214) and I think it would be useful to let Any feeling on (eventually) removing the module tunable? Thanks. |
My only thought would be wanting to tune metadata versus data prefetch versus none at all, but I have no workloads that this impacts, so I have no suggestions about how much it matters... |
Do you think something as |
Tri-state switch would be more functional. In support of metadata prefetch, we are now prefetching indirect blocks for write, and I remember when I implemented it it did improve write speeds by not delaying them while trying to read the indirect from pool already busy by async writes. Speaking about terminology though, ZFS has two independent types of prefetch: prescient and speculative, and the parameter control only the last, while may be interpreted differently. Setting it to metadata could be interpreted as prefetching indirect blocks for data accesses, or all metadata accesses including L0. Just a thoughts. |
Ok, I'll try to implement it.
Sure, prescient prefetch is always (rightfully) enabled and this patch (nor the module tunable) change that. |
The prefetcher itself can do only indirects already, as I have mentioned it does it for writes. So it should be trivial. |
e8ef6c4
to
8175237
Compare
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 needs the style fix and documentation in zfsprops man page.
Done. |
I just corrected a minor style issue. |
Since there has been a change in |
ZFS prefetch is currently governed by the zfs_prefetch_disable tunable. However, this is a module-wide settings - if a specific dataset benefits from prefetch, while others have issue with it, an optimal solution does not exists. This commit introduce the "prefetch" tri-state property, which enable granular control (at dataset/volume level) for prefetching. This patch does not remove the zfs_prefetch_disable, which reimains a system-wide switch for enable/disable prefetch. However, to avoid duplication, it would be preferable to deprecate and then remove the module tunable. Signed-off-by: Gionatan Danti <[email protected]>
Done, thanks. |
Anything I can/should do to get review approval for this PR? Thanks. |
@behlendorf any chances to review this patch? Thanks. |
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.
@shodanshok thanks for your patience. If you can rebase this on master and update the PR it should be good to go.
I just synched my branch to master via github "sync" feature. Thank you so much for reviewing this patch. |
The CI failures here are unexpected and look unrelated, but we hit them on multiple builders so clearly something isn't quite right. I see this PR wasn't created on its own branch, I've gone ahead and opened a new PR #15436 to get a fresh test run with the minimal patch cleanly applied to the master branch. Let's see how that goes. |
I noticed the build failures but from their logs I did not spot anything obviously related to this patch.
Did I do something non-optimal with the clone/sync from master? Can the build failures be related to that? Are patches better committed in dedicated branches? Sorry if these are basic questions, just trying to better understand for future commits. And thanks for taking the time to create #15436 |
It looks like the CI failures we caused by 797f55e which I just reverted from master with #15438. Assuming that we get a good CI run in #15436 which doesn't include that commit we should be in good shape.
Yes. When opening a new PR it's generally best to make the change on its own branch. This makes it easy to |
ZFS prefetch is currently governed by the zfs_prefetch_disable tunable. However, this is a module-wide settings - if a specific dataset benefits from prefetch, while others have issue with it, an optimal solution does not exists. This commit introduce the "prefetch" tri-state property, which enable granular control (at dataset/volume level) for prefetching. This patch does not remove the zfs_prefetch_disable, which remains a system-wide switch for enable/disable prefetch. However, to avoid duplication, it would be preferable to deprecate and then remove the module tunable. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Signed-off-by: Gionatan Danti <[email protected]> Co-authored-by: Gionatan Danti <[email protected]> Closes openzfs#15237 Closes openzfs#15436
ZFS prefetch is currently governed by the zfs_prefetch_disable tunable. However, this is a module-wide settings - if a specific dataset benefits from prefetch, while others have issue with it, an optimal solution does not exists. This commit introduce the "prefetch" tri-state property, which enable granular control (at dataset/volume level) for prefetching. This patch does not remove the zfs_prefetch_disable, which remains a system-wide switch for enable/disable prefetch. However, to avoid duplication, it would be preferable to deprecate and then remove the module tunable. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Signed-off-by: Gionatan Danti <[email protected]> Co-authored-by: Gionatan Danti <[email protected]> Closes #15237 Closes #15436
ZFS prefetch is currently governed by the zfs_prefetch_disable
tunable. However, this is a module-wide settings - if a specific
dataset benefits from prefetch, while others have issue with it,
an optimal solution does not exists.
This commit introduce the "prefetch" tri-state property, which enable
granular control (at dataset/volume level) for prefetching.
This patch does not remove the zfs_prefetch_disable, which reimains
a system-wide switch for enable/disable prefetch. However, to avoid
duplication, it would be preferable to deprecate and then remove
the module tunable.
Motivation and Context
Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.